Use C++11-style non-static data member initialization

This commit is contained in:
Ray Speth 2023-03-07 09:42:54 -05:00 committed by Ingmar Schoegl
parent b8d07edba9
commit a8fa093fb8
190 changed files with 885 additions and 1681 deletions

View File

@ -97,6 +97,8 @@
* For any new code, do *not* use the `doublereal` and `integer` typedefs for the
basic types `double` and `int`, but also do not go out of your way to change
uses of these in otherwise unmodified code.
* Initialize member variables with their declarations, when possible, rather than using
constructor-based initialization.
## Python

View File

@ -34,8 +34,8 @@ namespace Cantera
//! objects.
class AnyBase {
public:
AnyBase();
virtual ~AnyBase() {};
AnyBase() = default;
virtual ~AnyBase() = default;
//! For values which are derived from an input file, set the line and column
//! of this value in that file. Used for providing context for some error
@ -49,11 +49,11 @@ public:
protected:
//! The line where this value occurs in the input file. Set to -1 for values
//! that weren't created from an input file.
int m_line;
int m_line = -1;
//! If m_line >= 0, the column where this value occurs in the input file.
//! If m_line == -1, a value used for determining output ordering
int m_column;
int m_column = 0;
//! Metadata relevant to an entire AnyMap tree, such as information about
// the input file used to create it

View File

@ -46,7 +46,7 @@ public:
/**
* Default constructor. Create an empty array.
*/
Array2D();
Array2D() = default;
//! Constructor.
/*!
@ -72,7 +72,7 @@ public:
Array2D(const Array2D& y);
virtual ~Array2D() {}
virtual ~Array2D() = default;
Array2D& operator=(const Array2D& y);
@ -249,10 +249,10 @@ protected:
vector_fp m_data;
//! Number of rows
size_t m_nrows;
size_t m_nrows = 0;
//! Number of columns
size_t m_ncols;
size_t m_ncols = 0;
};
//! Output the current contents of the Array2D object

View File

@ -69,15 +69,15 @@ private:
//! Scale the unit by the factor `k`
void scale(double k) { m_factor *= k; }
double m_factor; //!< conversion factor to Cantera base units
double m_mass_dim;
double m_length_dim;
double m_time_dim;
double m_temperature_dim;
double m_current_dim;
double m_quantity_dim;
double m_pressure_dim; //!< pseudo-dimension to track explicit pressure units
double m_energy_dim; //!< pseudo-dimension to track explicit energy units
double m_factor = 1.0; //!< conversion factor to Cantera base units
double m_mass_dim = 0.0;
double m_length_dim = 0.0;
double m_time_dim = 0.0;
double m_temperature_dim = 0.0;
double m_current_dim = 0.0;
double m_quantity_dim = 0.0;
double m_pressure_dim = 0.0; //!< pseudo-dimension to track explicit pressure units
double m_energy_dim = 0.0; //!< pseudo-dimension to track explicit energy units
friend class UnitSystem;
};
@ -254,29 +254,29 @@ public:
private:
//! Factor to convert mass from this unit system to kg
double m_mass_factor;
double m_mass_factor = 1.0;
//! Factor to convert length from this unit system to meters
double m_length_factor;
double m_length_factor = 1.0;
//! Factor to convert time from this unit system to seconds
double m_time_factor;
double m_time_factor = 1.0;
//! Factor to convert pressure from this unit system to Pa
double m_pressure_factor;
double m_pressure_factor = 1.0;
//! Factor to convert energy from this unit system to J
double m_energy_factor;
double m_energy_factor = 1.0;
//! Factor to convert activation energy from this unit system to J/kmol
double m_activation_energy_factor;
double m_activation_energy_factor = 1.0;
//! Factor to convert quantity from this unit system to kmol
double m_quantity_factor;
double m_quantity_factor = 1.0;
//! True if activation energy units are set explicitly, rather than as a
//! combination of energy and quantity units
bool m_explicit_activation_energy;
bool m_explicit_activation_energy = false;
//! Map of dimensions (mass, length, etc.) to names of specified default
//! units

View File

@ -30,13 +30,7 @@ namespace Cantera
*/
template <class T>
struct CachedValue {
CachedValue() :
state1(std::numeric_limits<double>::quiet_NaN()),
state2(std::numeric_limits<double>::quiet_NaN()),
stateNum(std::numeric_limits<int>::min()),
value(T())
{
}
CachedValue() = default;
//! Check whether the currently cached value is valid based on
//! a single state variable. If it is not valid it updates the stored
@ -104,18 +98,18 @@ struct CachedValue {
//! Value of the first state variable for the state at which #value was
//! evaluated, for example temperature.
double state1;
double state1 = std::numeric_limits<double>::quiet_NaN();
//! Value of the second state variable for the state at which #value was
//! evaluated, for example density or pressure.
double state2;
double state2 = std::numeric_limits<double>::quiet_NaN();
//! A surrogate for the composition. For cached properties of Phase,
//! this should be set to Phase::stateMFNumber()
int stateNum;
int stateNum = std::numeric_limits<int>::min();
//! The value of the cached property
T value;
T value = T();
};
typedef CachedValue<double>& CachedScalar;

View File

@ -22,7 +22,7 @@ class Transport;
class YamlWriter
{
public:
YamlWriter();
YamlWriter() = default;
//! Include top-level information used in YAML header block
void setHeader(const AnyMap& header);
@ -76,10 +76,10 @@ protected:
std::vector<shared_ptr<Solution>> m_phases;
//! See setPrecision()
long int m_float_precision;
long int m_float_precision = 15;
//! See skipUserDefined()
bool m_skip_user_defined;
bool m_skip_user_defined = false;
//! Top-level units directive for the output file. Defaults to Cantera's
//! native SI+kmol system.

View File

@ -25,33 +25,31 @@ int _equilflag(const char* xy);
class EquilOpt
{
public:
EquilOpt() : relTolerance(1.e-8), absElemTol(1.0E-70),maxIterations(1000),
iterations(0),
maxStepSize(10.0), propertyPair(TP), contin(false) {}
EquilOpt() = default;
doublereal relTolerance; //! < Relative tolerance
doublereal absElemTol; //! < Abs Tol in element number
int maxIterations; //! < Maximum number of iterations
int iterations; //! < Iteration counter
double relTolerance = 1e-8; //!< Relative tolerance
double absElemTol = 1e-70; //!< Abs Tol in element number
int maxIterations = 1000; //!< Maximum number of iterations
int iterations = 0; //!< Iteration counter
/**
* Maximum step size. Largest change in any element potential or
* in log(T) allowed in one Newton step. Default: 10.0
* in log(T) allowed in one Newton step.
*/
doublereal maxStepSize;
double maxStepSize = 10.0;
/**
* Property pair flag. Determines which two thermodynamic properties
* are fixed.
*/
int propertyPair;
int propertyPair = TP;
/**
* Continuation flag. Set true if the calculation should be initialized from
* the last calculation. Otherwise, the calculation will be started from
* scratch and the initial composition and element potentials estimated.
*/
bool contin;
bool contin = false;
};
/**
@ -80,7 +78,7 @@ public:
class ChemEquil
{
public:
ChemEquil();
ChemEquil() = default;
//! Constructor combined with the initialization function
/*!
@ -91,7 +89,7 @@ public:
*/
ChemEquil(ThermoPhase& s);
virtual ~ChemEquil();
virtual ~ChemEquil() = default;
/*!
* Equilibrate a phase, holding the elemental composition fixed at the
@ -249,7 +247,7 @@ protected:
size_t m_mm; //!< number of elements in the phase
size_t m_kk; //!< number of species in the phase
size_t m_skip;
size_t m_skip = npos;
//! This is equal to the rank of the stoichiometric coefficient matrix when
//! it is computed. It's initialized to #m_mm.
@ -262,7 +260,7 @@ protected:
//! Current value of the sum of the element abundances given the current
//! element potentials.
doublereal m_elementTotalSum;
double m_elementTotalSum = 1.0;
//! Current value of the element mole fractions. Note these aren't the goal
//! element mole fractions.
@ -274,11 +272,11 @@ protected:
//! Storage of the element compositions. natom(k,m) = m_comp[k*m_mm+ m];
vector_fp m_comp;
doublereal m_temp, m_dens;
doublereal m_p0;
double m_p0 = OneAtm;
//! Index of the element id corresponding to the electric charge of each
//! species. Equal to -1 if there is no such element id.
size_t m_eloc;
size_t m_eloc = npos;
vector_fp m_startSoln;
@ -292,8 +290,8 @@ protected:
std::vector<size_t> m_component;
//! element fractional cutoff, below which the element will be zeroed.
double m_elemFracCutoff;
bool m_doResPerturb;
double m_elemFracCutoff = 1e-100;
bool m_doResPerturb = false;
std::vector<size_t> m_orderVectorElements;
std::vector<size_t> m_orderVectorSpecies;

View File

@ -64,11 +64,11 @@ public:
* The constructor takes no arguments, since phases are added using
* method addPhase().
*/
MultiPhase();
MultiPhase() = default;
//! Destructor. Does nothing. Class MultiPhase does not take "ownership"
//! (that is, responsibility for destroying) the phase objects.
virtual ~MultiPhase() {}
virtual ~MultiPhase() = default;
//! Add a vector of phases to the mixture
/*!
@ -618,23 +618,23 @@ private:
std::map<std::string, size_t> m_enamemap;
//! Current value of the temperature (kelvin)
doublereal m_temp;
double m_temp = 298.15;
//! Current value of the pressure (Pa)
doublereal m_press;
double m_press = OneBar;
//! Number of distinct elements in all of the phases
size_t m_nel;
size_t m_nel = 0;
//! Number of distinct species in all of the phases
size_t m_nsp;
size_t m_nsp = 0;
//! True if the init() routine has been called, and the MultiPhase frozen
bool m_init;
bool m_init = false;
//! Global ID of the element corresponding to the electronic charge. If
//! there is none, then this is equal to -1
size_t m_eloc;
size_t m_eloc = npos;
//! Vector of bools indicating whether temperatures are ok for phases.
/*!
@ -645,11 +645,11 @@ private:
//! Minimum temperature for which thermo parameterizations are valid.
//! Stoichiometric phases are ignored in this determination. units Kelvin
doublereal m_Tmin;
double m_Tmin = 1.0;
//! Minimum temperature for which thermo parameterizations are valid.
//! Stoichiometric phases are ignored in this determination. units Kelvin
doublereal m_Tmax;
double m_Tmax = 100000.0;
//! Vector of element abundances
/*!

View File

@ -165,8 +165,9 @@ protected:
}
size_t m_nel_mix, m_nsp_mix;
size_t m_nel, m_nsp;
size_t m_eloc;
size_t m_nel = 0;
size_t m_nsp = 0;
size_t m_eloc = 1000;
int m_iter;
MultiPhase* m_mix;
doublereal m_press, m_temp;
@ -186,7 +187,7 @@ protected:
std::vector<size_t> m_species;
std::vector<size_t> m_element;
std::vector<bool> m_solnrxn;
bool m_force;
bool m_force = true;
};
}

View File

@ -27,10 +27,10 @@ public:
std::string SpName;
//! Pointer to the thermo structure for this species
VCS_SPECIES_THERMO* SpeciesThermo;
VCS_SPECIES_THERMO* SpeciesThermo = nullptr;
//! Molecular Weight of the species (gm/mol)
double WtSpecies;
double WtSpecies = 0.0;
//! Column of the formula matrix, comprising the
//! element composition of the species
@ -38,10 +38,10 @@ public:
//! Charge state of the species -> This may be duplication of what's in the
//! FormulaMatrixCol entries. However, it's prudent to separate it out.
double Charge;
double Charge = 0.0;
//! True if this species belongs to a surface phase
int SurfaceSpecies;
int SurfaceSpecies = 0;
/*
* Various Calculated Quantities that are appropriate to keep copies of at
@ -49,28 +49,22 @@ public:
*/
//! Partial molar volume of the species
double VolPM;
double VolPM = 0.0;
//! Representative value of the mole fraction of this species in a phase.
//! This value is used for convergence issues and for calculation of
//! numerical derivatives
double ReferenceMoleFraction;
double ReferenceMoleFraction = 1e-6;
vcs_SpeciesProperties(size_t indexPhase, size_t indexSpeciesPhase,
vcs_VolPhase* owning)
: IndexPhase(indexPhase)
, IndexSpeciesPhase(indexSpeciesPhase)
, OwningPhase(owning)
, SpeciesThermo(0)
, WtSpecies(0.0)
, Charge(0.0)
, SurfaceSpecies(0)
, VolPM(0.0)
, ReferenceMoleFraction(1.0E-6)
{
}
virtual ~vcs_SpeciesProperties() {}
virtual ~vcs_SpeciesProperties() = default;
};
}

View File

@ -9,7 +9,8 @@
#ifndef VCS_VOLPHASE_H
#define VCS_VOLPHASE_H
#include "cantera/equil/vcs_SpeciesProperties.h"
#include "vcs_SpeciesProperties.h"
#include "vcs_defs.h"
#include "cantera/base/Array.h"
namespace Cantera
@ -527,7 +528,7 @@ private:
private:
//! Backtrack value of VCS_SOLVE *
VCS_SOLVE* m_owningSolverObject;
VCS_SOLVE* m_owningSolverObject = nullptr;
public:
//! Original ID of the phase in the problem.
@ -535,23 +536,23 @@ public:
* If a non-ideal phase splits into two due to a miscibility gap, these
* numbers will stay the same after the split.
*/
size_t VP_ID_;
size_t VP_ID_ = npos;
//! If true, this phase consists of a single species
bool m_singleSpecies;
bool m_singleSpecies = true;
//! If true, this phase is a gas-phase like phase
/*!
* A RTlog(p/1atm) term is added onto the chemical potential for inert
* species if this is true.
*/
bool m_gasPhase;
bool m_gasPhase = false;
//! Type of the equation of state
/*!
* The known types are listed at the top of this file.
*/
int m_eqnState;
int m_eqnState = VCS_EOS_CONSTANT;
//! This is the element number for the charge neutrality condition of the
//! phase
@ -559,7 +560,7 @@ public:
* If it has one. If it does not have a charge neutrality
* constraint, then this value is equal to -1
*/
size_t ChargeNeutralityElement;
size_t ChargeNeutralityElement = npos;
//! Convention for the activity formulation
/*!
@ -567,14 +568,14 @@ public:
* * 1 = Molality based activities, mu = mu_0 + ln a_molality. Standard
* state is based on unity molality
*/
int p_activityConvention;
int p_activityConvention = 0;
private:
//! Number of element constraints within the problem
/*!
* This is usually equal to the number of elements.
*/
size_t m_numElemConstraints;
size_t m_numElemConstraints = 0;
//! vector of strings containing the element constraint names
/*!
@ -620,7 +621,7 @@ private:
std::vector<size_t> m_elemGlobalIndex;
//! Number of species in the phase
size_t m_numSpecies;
size_t m_numSpecies = 0;
public:
//! String name for the phase
@ -628,12 +629,12 @@ public:
private:
//! Total moles of inert in the phase
double m_totalMolesInert;
double m_totalMolesInert = 0.0;
//! Boolean indicating whether the phase is an ideal solution
//! and therefore its molar-based activity coefficients are
//! uniformly equal to one.
bool m_isIdealSoln;
bool m_isIdealSoln = false;
//! Current state of existence:
/*!
@ -649,7 +650,7 @@ private:
* because it consists of a single species, which is identified with the
* voltage, for example, its an electron metal phase.
*/
int m_existence;
int m_existence = VCS_PHASE_EXIST_NO;
// Index of the first MF species in the list of unknowns for this phase
/*!
@ -659,7 +660,7 @@ private:
* to 0 for single species phases, where we set by hand the mole fraction
* of species 0 to one.
*/
int m_MFStartIndex;
int m_MFStartIndex = 0;
//! Index into the species vectors
/*!
@ -679,10 +680,10 @@ private:
* If we are using Cantera, this is the pointer to the ThermoPhase
* object. If not, this is null.
*/
ThermoPhase* TP_ptr;
ThermoPhase* TP_ptr = nullptr;
//! Total mols in the phase. units are kmol
double v_totalMoles;
double v_totalMoles = 0.0;
//! Vector of the current mole fractions for species in the phase
vector_fp Xmol_;
@ -712,10 +713,10 @@ private:
//! If the potential is a solution variable in VCS, it acts as a species.
//! This is the species index in the phase for the potential
size_t m_phiVarIndex;
size_t m_phiVarIndex = npos;
//! Total Volume of the phase. Units are m**3.
mutable double m_totalVol;
mutable double m_totalVol = 0.0;
//! Vector of calculated SS0 chemical potentials for the
//! current Temperature.
@ -763,14 +764,14 @@ private:
* - VCS_STATECALC_NEW
* - VCS_STATECALC_TMP
*/
int m_vcsStateStatus;
int m_vcsStateStatus = VCS_STATECALC_OLD;
//! Value of the potential for the phase (Volts)
double m_phi;
double m_phi = 0.0;
//! Boolean indicating whether the object has an up-to-date mole number vector
//! and potential with respect to the current vcs state calc status
bool m_UpToDate;
bool m_UpToDate = false;
//! Boolean indicating whether activity coefficients are up to date.
/*!
@ -778,7 +779,7 @@ private:
* called when they are needed (and when the state has changed so that they
* need to be recalculated).
*/
mutable bool m_UpToDate_AC;
mutable bool m_UpToDate_AC = false;
//! Boolean indicating whether Star volumes are up to date.
/*!
@ -787,7 +788,7 @@ private:
* need to be recalculated). Star volumes are sensitive to temperature and
* pressure
*/
mutable bool m_UpToDate_VolStar;
mutable bool m_UpToDate_VolStar = false;
//! Boolean indicating whether partial molar volumes are up to date.
/*!
@ -796,25 +797,25 @@ private:
* need to be recalculated). partial molar volumes are sensitive to
* everything
*/
mutable bool m_UpToDate_VolPM;
mutable bool m_UpToDate_VolPM = false;
//! Boolean indicating whether GStar is up to date.
/*!
* GStar is sensitive to the temperature and the pressure, only
*/
mutable bool m_UpToDate_GStar;
mutable bool m_UpToDate_GStar = false;
//! Boolean indicating whether G0 is up to date.
/*!
* G0 is sensitive to the temperature and the pressure, only
*/
mutable bool m_UpToDate_G0;
mutable bool m_UpToDate_G0 = false;
//! Current value of the temperature for this object, and underlying objects
double Temp_;
double Temp_ = 273.15;
//! Current value of the pressure for this object, and underlying objects
double Pres_;
double Pres_ = OneAtm;
};
}

View File

@ -1045,13 +1045,13 @@ public:
size_t m_nsp;
//! Number of element constraints in the problem
size_t m_nelem;
size_t m_nelem = 0;
//! Number of components calculated for the problem
size_t m_numComponents;
size_t m_numComponents = 0;
//! Total number of non-component species in the problem
size_t m_numRxnTot;
size_t m_numRxnTot = 0;
//! Current number of species in the problems. Species can be deleted if
//! they aren't stable under the current conditions
@ -1059,11 +1059,11 @@ public:
//! Current number of non-component species in the problem. Species can be
//! deleted if they aren't stable under the current conditions
size_t m_numRxnRdc;
size_t m_numRxnRdc = 0;
//! Number of active species which are currently either treated as
//! minor species
size_t m_numRxnMinorZeroed;
size_t m_numRxnMinorZeroed = 0;
//! Number of Phases in the problem
size_t m_numPhases;
@ -1143,7 +1143,7 @@ public:
* 1 Only do an estimate if the element abundances aren't satisfied.
* -1 Force an estimate of the soln. Throw out the input mole numbers.
*/
int m_doEstimateEquil;
int m_doEstimateEquil = -1;
//! Total moles of the species
/*!
@ -1236,7 +1236,7 @@ public:
* This number includes the inerts.
* -> Don't use this except for scaling purposes
*/
double m_totalMolNum;
double m_totalMolNum = 0.0;
//! Total kmols of species in each phase
/*!
@ -1281,16 +1281,16 @@ public:
vector_fp TPhInertMoles;
//! Tolerance requirement for major species
double m_tolmaj;
double m_tolmaj= 1e-8;
//! Tolerance requirements for minor species
double m_tolmin;
double m_tolmin = 1e-6;
//! Below this, major species aren't refined any more
double m_tolmaj2;
double m_tolmaj2 = 1e-10;
//! Below this, minor species aren't refined any more
double m_tolmin2;
double m_tolmin2 = 1e-8;
//! Index vector that keeps track of the species vector rearrangement
/*!
@ -1466,7 +1466,7 @@ public:
* If this is true, then we will use a better approximation to the Hessian
* based on Jacobian of the ln(ActCoeff) with respect to mole numbers
*/
int m_useActCoeffJac;
int m_useActCoeffJac = 0;
//! Total volume of all phases. Units are m^3
double m_totalVol;
@ -1482,7 +1482,7 @@ public:
double m_Faraday_dim;
//! Timing and iteration counters for the vcs object
VCS_COUNTERS* m_VCount;
VCS_COUNTERS* m_VCount = nullptr;
//! Debug printing lvl
/*!
@ -1496,14 +1496,14 @@ public:
* * 6 Each decision in solve_TP gets a line per species in addition to 4
* * 10 Additionally Hessian matrix is printed out
*/
int m_debug_print_lvl;
int m_debug_print_lvl = 0;
//! printing level of timing information
/*!
* * 1 allowing printing of timing
* * 0 do not allow printing of timing -> everything is printed as a NA.
*/
int m_timing_print_lvl;
int m_timing_print_lvl = 1;
//! Disable printing of timing information. Used to generate consistent
//! output for tests.

View File

@ -35,69 +35,52 @@ class VCS_SPECIES_THERMO
* All objects are public for ease of development
*/
public:
VCS_SPECIES_THERMO() = default;
//! Index of the phase that this species belongs to.
size_t IndexPhase;
size_t IndexPhase = 0;
//! Index of this species in the current phase.
size_t IndexSpeciesPhase;
size_t IndexSpeciesPhase = 0;
//! Pointer to the owning phase object.
vcs_VolPhase* OwningPhase;
vcs_VolPhase* OwningPhase = nullptr;
//! Integer representing the models for the species standard state Naught
//! temperature dependence. They are listed above and start with VCS_SS0_...
int SS0_Model;
int SS0_Model = VCS_SS0_CONSTANT;
//! Internal storage of the last calculation of the reference naught Gibbs
//! free energy at SS0_TSave. (always in units of Kelvin)
double SS0_feSave;
double SS0_feSave = 0.0;
//! Internal storage of the last temperature used in the calculation of the
//! reference naught Gibbs free energy. units = kelvin
double SS0_TSave;
double SS0_TSave = -90.0;
//! Base temperature used in the VCS_SS0_CONSTANT_CP model
double SS0_T0;
double SS0_T0 = 273.15;
//! Base enthalpy used in the VCS_SS0_CONSTANT_CP model
double SS0_H0;
double SS0_H0 = 0.0;
//! Base entropy used in the VCS_SS0_CONSTANT_CP model
double SS0_S0;
double SS0_S0 = 0.0;
//! Base heat capacity used in the VCS_SS0_CONSTANT_CP model
double SS0_Cp0;
double SS0_Cp0 = 0.0;
//! Value of the pressure for the reference state.
//! defaults to 1.01325E5 = 1 atm
double SS0_Pref;
double SS0_Pref = OneAtm;
//! Integer value representing the star state model.
int SSStar_Model;
int SSStar_Model = VCS_SSSTAR_CONSTANT;
//! Models for the standard state volume of each species
int SSStar_Vol_Model;
int SSStar_Vol_Model = VCS_SSVOL_IDEALGAS;
//! parameter that is used in the VCS_SSVOL_CONSTANT model.
double SSStar_Vol0;
VCS_SPECIES_THERMO()
: IndexPhase(0)
, IndexSpeciesPhase(0)
, OwningPhase(0)
, SS0_Model(VCS_SS0_CONSTANT)
, SS0_feSave(0.0)
, SS0_TSave(-90.0)
, SS0_T0(273.15)
, SS0_H0(0.0)
, SS0_S0(0.0)
, SS0_Cp0(0.0)
, SS0_Pref(1.01325E5)
, SSStar_Model(VCS_SSSTAR_CONSTANT)
, SSStar_Vol_Model(VCS_SSVOL_IDEALGAS)
, SSStar_Vol0(-1.0)
{
}
double SSStar_Vol0 = -1;
};
}

View File

@ -18,7 +18,7 @@ namespace Cantera
*/
struct BlowersMaselData : public ReactionData
{
BlowersMaselData();
BlowersMaselData() = default;
virtual void update(double T) override;
virtual bool update(const ThermoPhase& phase, const Kinetics& kin) override;
@ -29,12 +29,12 @@ struct BlowersMaselData : public ReactionData
ready = true;
}
bool ready; //!< boolean indicating whether vectors are accessible
double density; //!< used to determine if updates are needed
bool ready = false; //!< boolean indicating whether vectors are accessible
double density = NAN; //!< used to determine if updates are needed
vector_fp partialMolarEnthalpies; //!< partial molar enthalpies
protected:
int m_state_mf_number; //!< integer that is incremented when composition changes
int m_state_mf_number = -1; //!< integer that is incremented when composition changes
};
@ -180,7 +180,7 @@ protected:
//! Pairs of species indices and multipliers to calculate enthalpy change
std::vector<std::pair<size_t, double>> m_stoich_coeffs;
double m_deltaH_R; //!< enthalpy change of reaction (in temperature units)
double m_deltaH_R = 0.0; //!< enthalpy change of reaction (in temperature units)
};
}

View File

@ -20,7 +20,7 @@ namespace Cantera
class BulkKinetics : public Kinetics
{
public:
BulkKinetics();
BulkKinetics() = default;
//! @deprecated To be removed after Cantera 3.0; code base only uses default.
BulkKinetics(ThermoPhase* thermo);
@ -76,8 +76,8 @@ protected:
vector_fp m_grt;
bool m_ROP_ok;
doublereal m_temp;
bool m_ROP_ok = false;
double m_temp = 0.0;
};
}

View File

@ -22,7 +22,7 @@ namespace Cantera
*/
struct ChebyshevData : public ReactionData
{
ChebyshevData() : pressure(NAN), log10P(0.), m_pressure_buf(-1.) {}
ChebyshevData() = default;
virtual void update(double T) override;
@ -50,11 +50,11 @@ struct ChebyshevData : public ReactionData
pressure = NAN;
}
double pressure; //!< pressure
double log10P; //!< base 10 logarithm of pressure
double pressure = NAN; //!< pressure
double log10P = 0.0; //!< base 10 logarithm of pressure
protected:
double m_pressure_buf; //!< buffered pressure
double m_pressure_buf = -1.0; //!< buffered pressure
};
//! Pressure-dependent rate expression where the rate coefficient is expressed
@ -90,7 +90,7 @@ class ChebyshevRate final : public ReactionRate
{
public:
//! Default constructor.
ChebyshevRate() : m_log10P(NAN), m_rate_units(Units(0.)) {}
ChebyshevRate() = default;
//! Constructor directly from coefficient array
/*!
@ -225,7 +225,7 @@ public:
void setData(const Array2D& coeffs);
protected:
double m_log10P; //!< value detecting updates
double m_log10P = NAN; //!< value detecting updates
double Tmin_, Tmax_; //!< valid temperature range
double Pmin_, Pmax_; //!< valid pressure range
double TrNum_, TrDen_; //!< terms appearing in the reduced temperature
@ -234,7 +234,7 @@ protected:
Array2D m_coeffs; //!<< coefficient array
vector_fp dotProd_; //!< dot product of coeffs with the reduced pressure polynomial
Units m_rate_units; //!< Reaction rate units
Units m_rate_units = Units(0.); //!< Reaction rate units
};
}

View File

@ -36,7 +36,7 @@ class Func1;
class CustomFunc1Rate final : public ReactionRate
{
public:
CustomFunc1Rate();
CustomFunc1Rate() = default;
CustomFunc1Rate(const AnyMap& node, const UnitStack& rate_units);
unique_ptr<MultiRateBase> newMultiRate() const override {

View File

@ -59,13 +59,15 @@ struct FalloffData : public ReactionData
molar_density = NAN;
}
bool ready; //!< boolean indicating whether vectors are accessible
double molar_density; //!< used to determine if updates are needed
bool ready = false; //!< boolean indicating whether vectors are accessible
double molar_density = NAN; //!< used to determine if updates are needed
vector_fp conc_3b; //!< vector of effective third-body concentrations
protected:
int m_state_mf_number; //!< integer that is incremented when composition changes
bool m_perturbed; //!< boolean indicating whether 3-rd body values are perturbed
//! integer that is incremented when composition changes
int m_state_mf_number = -1;
//! boolean indicating whether 3-rd body values are perturbed
bool m_perturbed = false;
vector_fp m_conc_3b_buf; //!< buffered third-body concentrations
};
@ -78,13 +80,7 @@ protected:
class FalloffRate : public ReactionRate
{
public:
FalloffRate()
: m_chemicallyActivated(false)
, m_negativeA_ok(false)
, m_rc_low(NAN)
, m_rc_high(NAN)
{
}
FalloffRate() = default;
FalloffRate(const AnyMap& node, const UnitStack& rate_units={});
@ -262,11 +258,13 @@ protected:
ArrheniusRate m_lowRate; //!< The reaction rate in the low-pressure limit
ArrheniusRate m_highRate; //!< The reaction rate in the high-pressure limit
bool m_chemicallyActivated; //!< Flag labeling reaction as chemically activated
bool m_negativeA_ok; //!< Flag indicating whether negative A values are permitted
//! Flag labeling reaction as chemically activated
bool m_chemicallyActivated = false;
//! Flag indicating whether negative A values are permitted
bool m_negativeA_ok = false;
double m_rc_low; //!< Evaluated reaction rate in the low-pressure limit
double m_rc_high; //!< Evaluated reaction rate in the high-pressure limit
double m_rc_low = NAN; //!< Evaluated reaction rate in the low-pressure limit
double m_rc_high = NAN; //!< Evaluated reaction rate in the high-pressure limit
vector_fp m_work; //!< Work vector
};

View File

@ -146,9 +146,9 @@ protected:
//! @name Reaction rate data
//! @{
doublereal m_logStandConc;
double m_logStandConc = 0.0;
doublereal m_pres; //!< Last pressure at which rates were evaluated
double m_pres = 0.0; //!< Last pressure at which rates were evaluated
//! @}

View File

@ -75,7 +75,7 @@ public:
double maxStepSize=0, size_t maxSteps=20000,
size_t maxErrTestFails=7);
virtual ~ImplicitSurfChem() {};
virtual ~ImplicitSurfChem() = default;
/*!
* Must be called before calling method 'advance'
@ -252,10 +252,10 @@ protected:
/*!
* This is the total number of unknowns in m_mode 0 problem
*/
size_t m_nv;
size_t m_nv = 0;
size_t m_numTotalBulkSpecies;
size_t m_numTotalSpecies;
size_t m_numTotalBulkSpecies = 0;
size_t m_numTotalSpecies = 0;
std::vector<vector_int> pLocVec;
//! Pointer to the CVODE integrator
@ -278,17 +278,17 @@ protected:
* Index into the species vector of the kinetics manager,
* pointing to the first species from the surrounding medium.
*/
int m_mediumSpeciesStart;
int m_mediumSpeciesStart = -1;
/**
* Index into the species vector of the kinetics manager, pointing to the
* first species from the condensed phase of the particles.
*/
int m_bulkSpeciesStart;
int m_bulkSpeciesStart = -1;
/**
* Index into the species vector of the kinetics manager, pointing to the
* first species from the surface of the particles
*/
int m_surfSpeciesStart;
int m_surfSpeciesStart = -1;
/**
* Pointer to the helper method, Placid, which solves the surface problem.
*/
@ -296,12 +296,12 @@ protected:
//! If true, a common temperature and pressure for all surface and bulk
//! phases associated with the surface problem is imposed
bool m_commonTempPressForPhases;
bool m_commonTempPressForPhases = true;
private:
//! Controls the amount of printing from this routine
//! and underlying routines.
int m_ioFlag;
int m_ioFlag = 0;
};
}

View File

@ -57,7 +57,7 @@ class InterfaceKinetics : public Kinetics
{
public:
//! Constructor
InterfaceKinetics();
InterfaceKinetics() = default;
//! Constructor
/*!
@ -316,7 +316,7 @@ protected:
*/
std::vector<size_t> m_revindex;
bool m_redo_rates;
bool m_redo_rates = false;
//! Vector of rate handlers for interface reactions
std::vector<unique_ptr<MultiRateBase>> m_interfaceRates;
@ -396,7 +396,7 @@ protected:
vector_fp m_phi;
//! Pointer to the single surface phase
SurfPhase* m_surf;
SurfPhase* m_surf = nullptr;
//! Pointer to the Implicit surface chemistry object
/*!
@ -404,12 +404,12 @@ protected:
* be used to solve this single InterfaceKinetics object's surface problem
* uncoupled from other surface phases.
*/
ImplicitSurfChem* m_integrator;
ImplicitSurfChem* m_integrator = nullptr;
bool m_ROP_ok;
bool m_ROP_ok = false;
//! Current temperature of the data
doublereal m_temp;
double m_temp = 0.0;
//! Int flag to indicate that some phases in the kinetics mechanism are
//! non-existent.
@ -418,7 +418,7 @@ protected:
* treated correctly in the kinetics operator. The value of this is equal
* to the number of phases which don't exist.
*/
int m_phaseExistsCheck;
int m_phaseExistsCheck = false;
//! Vector of booleans indicating whether phases exist or not
/*!
@ -459,11 +459,11 @@ protected:
*/
std::vector<std::vector<bool> > m_rxnPhaseIsProduct;
int m_ioFlag;
int m_ioFlag = 0;
//! Number of dimensions of reacting phase (2 for InterfaceKinetics, 1 for
//! EdgeKinetics)
size_t m_nDim;
size_t m_nDim = 2;
};
}

View File

@ -38,7 +38,7 @@ class AnyMap;
*/
struct InterfaceData : public BlowersMaselData
{
InterfaceData();
InterfaceData() = default;
virtual bool update(const ThermoPhase& bulk, const Kinetics& kin) override;
@ -60,7 +60,7 @@ struct InterfaceData : public BlowersMaselData
ready = true;
}
double sqrtT; //!< square root of temperature
double sqrtT = NAN; //!< square root of temperature
vector_fp coverages; //!< surface coverages
vector_fp logCoverages; //!< logarithm of surface coverages

View File

@ -117,9 +117,9 @@ public:
//! @{
//! Default constructor.
Kinetics();
Kinetics() = default;
virtual ~Kinetics();
virtual ~Kinetics() = default;
//! Kinetics objects are not copyable or assignable
Kinetics(const Kinetics&) = delete;
@ -1304,11 +1304,11 @@ protected:
//! @}
//! Boolean indicating whether Kinetics object is fully configured
bool m_ready;
bool m_ready = false;
//! The number of species in all of the phases
//! that participate in this kinetics mechanism.
size_t m_kk;
size_t m_kk = 0;
//! Vector of perturbation factors for each reaction's rate of
//! progress vector. It is initialized to one.
@ -1352,17 +1352,17 @@ protected:
//! Index in the list of phases of the one surface phase.
//! @deprecated To be removed after Cantera 3.0.
size_t m_surfphase;
size_t m_surfphase = npos;
//! Phase Index where reactions are assumed to be taking place
/*!
* We calculate this by assuming that the phase with the lowest
* dimensionality is the phase where reactions are taking place.
*/
size_t m_rxnphase;
size_t m_rxnphase = npos;
//! number of spatial dimensions of lowest-dimensional phase.
size_t m_mindim;
size_t m_mindim = 4;
//! Forward rate constant for each reaction
vector_fp m_rfn;
@ -1389,10 +1389,10 @@ protected:
vector_fp m_rbuf;
//! See skipUndeclaredSpecies()
bool m_skipUndeclaredSpecies;
bool m_skipUndeclaredSpecies = false;
//! See skipUndeclaredThirdBodies()
bool m_skipUndeclaredThirdBodies;
bool m_skipUndeclaredThirdBodies = false;
//! reference to Solution
std::weak_ptr<Solution> m_root;

View File

@ -18,7 +18,7 @@ namespace Cantera
*/
struct PlogData : public ReactionData
{
PlogData() : pressure(NAN), logP(0.), m_pressure_buf(-1.) {}
PlogData() = default;
virtual void update(double T) override;
@ -46,11 +46,11 @@ struct PlogData : public ReactionData
pressure = NAN;
}
double pressure; //!< pressure
double logP; //!< logarithm of pressure
double pressure = NAN; //!< pressure
double logP = 0.0; //!< logarithm of pressure
protected:
double m_pressure_buf; //!< buffered pressure
double m_pressure_buf = -1.0; //!< buffered pressure
};
@ -76,7 +76,7 @@ class PlogRate final : public ReactionRate
{
public:
//! Default constructor.
PlogRate();
PlogRate() = default;
//! Constructor from Arrhenius rate expressions at a set of pressures
explicit PlogRate(const std::multimap<double, ArrheniusRate>& rates);
@ -186,8 +186,9 @@ protected:
// Rate expressions which are referenced by the indices stored in pressures_
std::vector<ArrheniusRate> rates_;
double logP_; //!< log(p) at the current state
double logP1_, logP2_; //!< log(p) at the lower / upper pressure reference
double logP_ = -1000; //!< log(p) at the current state
double logP1_ = 1000; //!< log(p) at the lower pressure reference
double logP2_ = -1000; //!< log(p) at the upper pressure reference
//! Indices to the ranges within rates_ for the lower / upper pressure, such
//! that rates_[ilow1_] through rates_[ilow2_] (inclusive) are the rates
@ -195,7 +196,7 @@ protected:
//! pressure.
size_t ilow1_, ilow2_, ihigh1_, ihigh2_;
double rDeltaP_; //!< reciprocal of (logP2 - logP1)
double rDeltaP_ = -1.0; //!< reciprocal of (logP2 - logP1)
};
}

View File

@ -24,7 +24,7 @@ class Kinetics;
*/
struct ReactionData
{
ReactionData() : temperature(1.), logT(0.), recipT(1.), m_temperature_buf(-1.) {}
ReactionData() = default;
//! Update data container based on temperature *T*
/**
@ -106,12 +106,12 @@ struct ReactionData
temperature = NAN;
}
double temperature; //!< temperature
double logT; //!< logarithm of temperature
double recipT; //!< inverse of temperature
double temperature = 1.0; //!< temperature
double logT = 0.0; //!< logarithm of temperature
double recipT = 1.0; //!< inverse of temperature
protected:
double m_temperature_buf; //!< buffered temperature
double m_temperature_buf = -1.0; //!< buffered temperature
};
}

View File

@ -27,17 +27,16 @@ class SpeciesNode
{
public:
//! Default constructor
SpeciesNode() : number(npos), value(0.0),
visible(false), m_in(0.0), m_out(0.0) {}
SpeciesNode() = default;
//! Destructor
virtual ~SpeciesNode() {}
virtual ~SpeciesNode() = default;
// public attributes
size_t number; //! < Species number
std::string name; //! < Label on graph
doublereal value; //! < May be used to set node appearance
bool visible; //! < Visible on graph;
size_t number = npos; //!< Species number
string name; //!< Label on graph
double value = 0.0; //!< May be used to set node appearance
bool visible = false; //!< Visible on graph;
//! @name References
//!
@ -73,8 +72,8 @@ public:
void printPaths();
protected:
doublereal m_in;
doublereal m_out;
double m_in = 0.0;
double m_out = 0.0;
std::vector<Path*> m_paths;
};
@ -151,7 +150,7 @@ protected:
std::map<std::string, doublereal> m_label;
SpeciesNode* m_a, *m_b;
rxn_path_map m_rxn;
doublereal m_total;
double m_total = 0.0;
};
@ -161,7 +160,7 @@ protected:
class ReactionPathDiagram
{
public:
ReactionPathDiagram();
ReactionPathDiagram() = default;
/**
* Destructor. Deletes all nodes and paths in the diagram.
@ -260,23 +259,28 @@ public:
}
// public attributes
std::string title;
std::string bold_color;
std::string normal_color;
std::string dashed_color;
std::string element;
std::string m_font;
doublereal threshold, bold_min, dashed_max, label_min;
doublereal x_size, y_size;
std::string name, dot_options;
flow_t flow_type;
doublereal scale;
doublereal arrow_width;
bool show_details;
doublereal arrow_hue;
string title;
string bold_color = "blue";
string normal_color = "steelblue";
string dashed_color = "gray";
string element;
string m_font = "Helvetica";
double threshold = 0.005;
double bold_min = 0.2;
double dashed_max = 0.0;
double label_min = 0.0;
double x_size = -1.0;
double y_size = -1.0;
string name = "reaction_paths";
string dot_options = "center=1;";
flow_t flow_type = NetFlow;
double scale = -1;
double arrow_width = -5.0;
bool show_details = false;
double arrow_hue = 0.6666;
protected:
doublereal m_flxmax;
double m_flxmax = 0.0;
std::map<size_t, std::map<size_t, Path*> > m_paths;
//! map of species index to SpeciesNode
@ -288,15 +292,15 @@ protected:
//! Indices of reactions that are included in the diagram
set<size_t> m_rxns;
size_t m_local;
size_t m_local = npos;
};
class ReactionPathBuilder
{
public:
ReactionPathBuilder() {}
virtual ~ReactionPathBuilder() {}
ReactionPathBuilder() = default;
virtual ~ReactionPathBuilder() = default;
int init(std::ostream& logfile, Kinetics& s);

View File

@ -330,15 +330,11 @@ private:
class C_AnyN
{
public:
C_AnyN() :
m_n(0),
m_rxn(npos) {
}
C_AnyN() = default;
C_AnyN(size_t rxn, const std::vector<size_t>& ic, const vector_fp& order_, const vector_fp& stoich_) :
m_n(0),
m_n(ic.size()),
m_rxn(rxn) {
m_n = ic.size();
m_ic.resize(m_n);
m_jc.resize(m_n, 0);
m_order.resize(m_n);
@ -443,7 +439,7 @@ private:
* and stoichiometric coefficient vectors for the reactant or product
* description of the reaction.
*/
size_t m_n;
size_t m_n = 0;
//! ID of the reaction corresponding to this stoichiometric manager
/*!
@ -451,7 +447,7 @@ private:
* and write to Normally this is associated with the reaction number in an
* array of quantities indexed by the reaction number, for example, ROP[irxn].
*/
size_t m_rxn;
size_t m_rxn = npos;
//! Vector of species which are involved with this stoichiometric manager
//! calculations

View File

@ -19,7 +19,7 @@ namespace Cantera
*/
struct TwoTempPlasmaData : public ReactionData
{
TwoTempPlasmaData() : electronTemp(1.), logTe(0.), recipTe(1.) {}
TwoTempPlasmaData() = default;
virtual bool update(const ThermoPhase& phase, const Kinetics& kin) override;
virtual void update(double T) override;
@ -33,9 +33,9 @@ struct TwoTempPlasmaData : public ReactionData
electronTemp = NAN;
}
double electronTemp; //!< electron temperature
double logTe; //!< logarithm of electron temperature
double recipTe; //!< inverse of electron temperature
double electronTemp = 1.0; //!< electron temperature
double logTe = 0.0; //!< logarithm of electron temperature
double recipTe = 1.0; //!< inverse of electron temperature
};

View File

@ -148,15 +148,11 @@ public:
*/
solveSP(ImplicitSurfChem* surfChemPtr, int bulkFunc = BULK_ETCH);
//! Destructor. Deletes the integrator.
~solveSP() {}
//! Destructor
~solveSP() = default;
private:
//! Unimplemented private copy constructor
solveSP(const solveSP& right);
//! Unimplemented private assignment operator
solveSP& operator=(const solveSP& right);
solveSP(const solveSP&) = delete;
solveSP& operator=(const solveSP&) = delete;
public:
//! Main routine that actually calculates the pseudo steady state
@ -303,13 +299,6 @@ private:
const doublereal* CSolnSPOld, const bool do_time,
const doublereal deltaT);
//! Pointer to the manager of the implicit surface chemistry problem
/*!
* This object actually calls the current object. Thus, we are providing a
* loop-back functionality here.
*/
ImplicitSurfChem* m_SurfChemPtr;
//! Vector of interface kinetics objects
/*!
* Each of these is associated with one and only one surface phase.
@ -320,7 +309,7 @@ private:
/*!
* Note, this can be zero, and frequently is
*/
size_t m_neq;
size_t m_neq = 0;
//! This variable determines how the bulk phases are to be handled
/*!
@ -333,7 +322,7 @@ private:
* This number is equal to the number of InterfaceKinetics objects
* in the problem. (until further noted)
*/
size_t m_numSurfPhases;
size_t m_numSurfPhases = 0;
//! Total number of surface species in all surface phases.
/*!
@ -341,7 +330,7 @@ private:
* It's equal to the sum of the number of species in each of the
* m_numSurfPhases.
*/
size_t m_numTotSurfSpecies;
size_t m_numTotSurfSpecies = 0;
//! Mapping between the surface phases and the InterfaceKinetics objects
/*!
@ -397,7 +386,7 @@ private:
*
* This is equal to 0, for the time being
*/
size_t m_numBulkPhasesSS;
size_t m_numBulkPhasesSS = 0;
//! Vector of number of species in the m_numBulkPhases phases.
/*!
@ -410,7 +399,7 @@ private:
* This is also the number of bulk equations to solve when bulk equation
* solving is turned on.
*/
size_t m_numTotBulkSpeciesSS;
size_t m_numTotBulkSpeciesSS = 0;
//! Vector of bulk phase pointers, length is equal to m_numBulkPhases.
std::vector<ThermoPhase*> m_bulkPhasePtrs;
@ -441,18 +430,9 @@ private:
*/
std::vector<size_t> m_spSurfLarge;
//! The absolute tolerance in real units. units are (kmol/m2)
doublereal m_atol;
//! The relative error tolerance.
doublereal m_rtol;
//! maximum value of the time step. units = seconds
doublereal m_maxstep;
//! Maximum number of species in any single kinetics operator
//! -> also maxed wrt the total # of solution species
size_t m_maxTotSpecies;
size_t m_maxTotSpecies = 0;
//! Temporary vector with length equal to max m_maxTotSpecies
vector_fp m_netProductionRatesSave;
@ -504,7 +484,7 @@ private:
DenseMatrix m_Jac;
public:
int m_ioflag;
int m_ioflag = 0;
};
}
#endif

View File

@ -268,16 +268,16 @@ protected:
vector_fp ludata;
//! Number of rows and columns of the matrix
size_t m_n;
size_t m_n = 0;
//! Number of subdiagonals of the matrix
size_t m_kl;
size_t m_kl = 0;
//! Number of super diagonals of the matrix
size_t m_ku;
size_t m_ku = 0;
//! value of zero
doublereal m_zero;
double m_zero = 0;
struct PivData; // pImpl wrapper class
@ -294,7 +294,7 @@ protected:
//! Extra dp work array needed - size = 3n
vector_fp work_;
int m_info;
int m_info = 0;
};
//! Utility routine to print out the matrix

View File

@ -90,33 +90,37 @@ protected:
private:
void sensInit(double t0, FuncEval& func);
size_t m_neq;
void* m_cvode_mem;
size_t m_neq = 0;
void* m_cvode_mem = nullptr;
SundialsContext m_sundials_ctx; //!< SUNContext object for Sundials>=6.0
void* m_linsol; //!< Sundials linear solver object
void* m_linsol_matrix; //!< matrix used by Sundials
FuncEval* m_func;
double m_t0;
void* m_linsol = nullptr; //!< Sundials linear solver object
void* m_linsol_matrix = nullptr; //!< matrix used by Sundials
FuncEval* m_func = nullptr;
double m_t0 = 0.0;
double m_time; //!< The current integrator time
N_Vector m_y, m_abstol;
N_Vector m_dky;
std::string m_type;
N_Vector m_y = nullptr;
N_Vector m_abstol = nullptr;
N_Vector m_dky = nullptr;
string m_type = "DENSE";
int m_itol;
int m_method;
int m_maxord;
double m_reltol;
double m_abstols;
double m_reltolsens, m_abstolsens;
size_t m_nabs;
double m_hmax, m_hmin;
int m_maxsteps;
int m_maxErrTestFails;
N_Vector* m_yS;
size_t m_np;
int m_mupper, m_mlower;
int m_maxord = 0;
double m_reltol = 1e-9;
double m_abstols = 1e-15;
double m_reltolsens = 1e-5;
double m_abstolsens = 1e-4;
size_t m_nabs = 0;
double m_hmax = 0.0;
double m_hmin = 0.0;
int m_maxsteps = 20000;
int m_maxErrTestFails = 0;
N_Vector* m_yS = nullptr;
size_t m_np = 0;
int m_mupper = 0;
int m_mlower = 0;
//! Indicates whether the sensitivities stored in m_yS have been updated
//! for at the current integrator time.
bool m_sens_ok;
bool m_sens_ok = false;
};
} // namespace

View File

@ -18,8 +18,8 @@ namespace Cantera
class Jacobian
{
public:
Jacobian() {}
virtual ~Jacobian() {}
Jacobian() = default;
virtual ~Jacobian() = default;
virtual bool supplied() {
return false;
}
@ -77,11 +77,11 @@ class DAE_Solver
public:
DAE_Solver(ResidJacEval& f) :
m_resid(f),
m_neq(f.nEquations()),
m_time(0.0) {
m_neq(f.nEquations())
{
}
virtual ~DAE_Solver() {}
virtual ~DAE_Solver() = default;
/**
* Set error tolerances. This version specifies a scalar
@ -247,7 +247,7 @@ protected:
//! Number of total equations in the system
integer m_neq;
doublereal m_time;
double m_time = 0.0;
private:
void warn(const std::string& msg) const {

View File

@ -51,7 +51,7 @@ class DenseMatrix : public Array2D
{
public:
//! Default Constructor
DenseMatrix();
DenseMatrix() = default;
//! Constructor.
/*!
@ -137,7 +137,7 @@ public:
* an error code, that is up to the calling routine to handle correctly.
* Negative return codes always throw an exception.
*/
int m_useReturnErrorCode;
int m_useReturnErrorCode = 0;
//! Print Level
/*!
@ -146,7 +146,7 @@ public:
* Level of printing that is carried out. Only error conditions are printed
* out, if this value is nonzero.
*/
int m_printLevel;
int m_printLevel = 0;
// Listing of friend functions which are defined below

View File

@ -43,9 +43,9 @@ class TimesConstant1;
class Func1
{
public:
Func1();
Func1() = default;
virtual ~Func1() {}
virtual ~Func1() = default;
Func1(const Func1& right);
@ -110,10 +110,10 @@ public:
void setParent(Func1* p);
protected:
doublereal m_c;
Func1* m_f1;
Func1* m_f2;
Func1* m_parent;
double m_c = 0.0;
Func1* m_f1 = nullptr;
Func1* m_f2 = nullptr;
Func1* m_parent = nullptr;
};
@ -133,8 +133,7 @@ Func1& newPlusConstFunction(Func1& f1, doublereal c);
class Sin1 : public Func1
{
public:
Sin1(doublereal omega = 1.0) :
Func1() {
Sin1(double omega=1.0) {
m_c = omega;
}
@ -176,8 +175,7 @@ public:
class Cos1 : public Func1
{
public:
Cos1(doublereal omega = 1.0) :
Func1() {
Cos1(double omega=1.0) {
m_c = omega;
}
@ -212,8 +210,7 @@ public:
class Exp1 : public Func1
{
public:
Exp1(doublereal A = 1.0) :
Func1() {
Exp1(double A=1.0) {
m_c = A;
}
@ -246,8 +243,7 @@ public:
class Pow1 : public Func1
{
public:
Pow1(doublereal n) :
Func1() {
Pow1(double n) {
m_c = n;
}
@ -287,7 +283,7 @@ public:
* @param method Interpolation method ('linear' or 'previous')
*/
Tabulated1(size_t n, const double* tvals, const double* fvals,
const std::string& method = "linear");
const string& method="linear");
virtual std::string write(const std::string& arg) const;
virtual int ID() const {
@ -320,8 +316,7 @@ public:
/*!
* @param A Constant
*/
Const1(double A) :
Func1() {
Const1(double A) {
m_c = A;
}
@ -361,8 +356,7 @@ public:
class Sum1 : public Func1
{
public:
Sum1(Func1& f1, Func1& f2) :
Func1() {
Sum1(Func1& f1, Func1& f2) {
m_f1 = &f1;
m_f2 = &f2;
m_f1->setParent(this);
@ -485,8 +479,7 @@ public:
class Product1 : public Func1
{
public:
Product1(Func1& f1, Func1& f2) :
Func1() {
Product1(Func1& f1, Func1& f2) {
m_f1 = &f1;
m_f2 = &f2;
m_f1->setParent(this);
@ -548,8 +541,7 @@ public:
class TimesConstant1 : public Func1
{
public:
TimesConstant1(Func1& f1, doublereal A) :
Func1() {
TimesConstant1(Func1& f1, double A) {
m_f1 = &f1;
m_c = A;
m_f1->setParent(this);
@ -623,8 +615,7 @@ public:
class PlusConstant1 : public Func1
{
public:
PlusConstant1(Func1& f1, doublereal A) :
Func1() {
PlusConstant1(Func1& f1, double A) {
m_f1 = &f1;
m_c = A;
m_f1->setParent(this);
@ -680,8 +671,7 @@ public:
class Ratio1 : public Func1
{
public:
Ratio1(Func1& f1, Func1& f2) :
Func1() {
Ratio1(Func1& f1, Func1& f2) {
m_f1 = &f1;
m_f2 = &f2;
m_f1->setParent(this);
@ -746,8 +736,7 @@ public:
class Composite1 : public Func1
{
public:
Composite1(Func1& f1, Func1& f2) :
Func1() {
Composite1(Func1& f1, Func1& f2) {
m_f1 = &f1;
m_f2 = &f2;
m_f1->setParent(this);
@ -823,8 +812,7 @@ public:
class Gaussian : public Func1
{
public:
Gaussian(double A, double t0, double fwhm) :
Func1() {
Gaussian(double A, double t0, double fwhm) {
m_A = A;
m_t0 = t0;
m_tau = fwhm/(2.0*std::sqrt(std::log(2.0)));
@ -868,8 +856,7 @@ protected:
class Poly1 : public Func1
{
public:
Poly1(size_t n, const double* c) :
Func1() {
Poly1(size_t n, const double* c) {
m_cpoly.resize(n+1);
std::copy(c, c+m_cpoly.size(), m_cpoly.begin());
}
@ -919,9 +906,7 @@ protected:
class Fourier1 : public Func1
{
public:
Fourier1(size_t n, double omega, double a0,
const double* a, const double* b) :
Func1() {
Fourier1(size_t n, double omega, double a0, const double* a, const double* b) {
m_omega = omega;
m_a0_2 = 0.5*a0;
m_ccos.resize(n);
@ -979,8 +964,7 @@ protected:
class Arrhenius1 : public Func1
{
public:
Arrhenius1(size_t n, const double* c) :
Func1() {
Arrhenius1(size_t n, const double* c) {
m_A.resize(n);
m_b.resize(n);
m_E.resize(n);
@ -1032,14 +1016,12 @@ protected:
class Periodic1 : public Func1
{
public:
Periodic1(Func1& f, doublereal T) :
Func1() {
Periodic1(Func1& f, double T) {
m_func = &f;
m_c = T;
}
Periodic1(const Periodic1& b) :
Func1() {
Periodic1(const Periodic1& b) {
*this = Periodic1::operator=(b);
}

View File

@ -27,8 +27,8 @@ namespace Cantera
class FuncEval
{
public:
FuncEval();
virtual ~FuncEval() {}
FuncEval() = default;
virtual ~FuncEval() = default;
/**
* Evaluate the right-hand-side function. Called by the integrator.
@ -138,7 +138,7 @@ public:
protected:
// If true, errors are accumulated in m_errors. Otherwise, they are printed
bool m_suppress_errors;
bool m_suppress_errors = false;
//! Errors occurring during function evaluations
std::vector<std::string> m_errors;

View File

@ -22,9 +22,9 @@ class GeneralMatrix
{
public:
//! Base Constructor
GeneralMatrix() : m_factored(false) {}
GeneralMatrix() = default;
virtual ~GeneralMatrix() {}
virtual ~GeneralMatrix() = default;
//! Zero the matrix elements
virtual void zero() = 0;
@ -184,7 +184,7 @@ public:
protected:
//! Indicates whether the matrix is factored. 0 for unfactored; Non-zero
//! values indicate a particular factorization (LU=1, QR=2).
int m_factored;
int m_factored = false;
};
}

View File

@ -223,44 +223,44 @@ public:
protected:
//! Pointer to the IDA memory for the problem
void* m_ida_mem;
void* m_linsol; //!< Sundials linear solver object
void* m_linsol_matrix; //!< matrix used by Sundials
void* m_ida_mem = nullptr;
void* m_linsol = nullptr; //!< Sundials linear solver object
void* m_linsol_matrix = nullptr; //!< matrix used by Sundials
SundialsContext m_sundials_ctx; //!< SUNContext object for Sundials>=6.0
//! Initial value of the time
doublereal m_t0;
double m_t0 = 0.0;
//! Current value of the solution vector
N_Vector m_y;
N_Vector m_y = nullptr;
//! Current value of the derivative of the solution vector
N_Vector m_ydot;
N_Vector m_id;
N_Vector m_constraints;
N_Vector m_abstol;
int m_type;
N_Vector m_ydot = nullptr;
N_Vector m_id = nullptr;
N_Vector m_constraints = nullptr;
N_Vector m_abstol = nullptr;
int m_type = 0;
int m_itol;
int m_iter;
doublereal m_reltol;
doublereal m_abstols;
int m_nabs;
int m_itol = IDA_SS;
int m_iter = 0;
double m_reltol = 1e-9;
double m_abstols = 1e-15;
int m_nabs = 0;
//! Maximum value of the timestep allowed
doublereal m_hmax;
double m_hmax = 0.0;
//! Minimum value of the timestep allowed
doublereal m_hmin;
double m_hmin = 0.0;
//! Value of the initial time step
doublereal m_h0;
double m_h0 = 0.0;
//! Maximum number of time steps allowed
int m_maxsteps;
int m_maxsteps = 20000;
//! maximum time step order of the method
int m_maxord;
int m_maxord = 0;
//! Form of the Jacobian
/*!
@ -269,41 +269,41 @@ protected:
* function in the ResidJacEval class.
* 2 numerical Jacobian formed by the ResidJacEval class (unimplemented)
*/
int m_formJac;
int m_formJac = 0;
//! maximum time
doublereal m_tstop;
double m_tstop = 0.0;
//! Value of the previous, previous time
doublereal m_told_old;
double m_told_old = 0.0;
//! Value of the previous time
doublereal m_told;
double m_told = 0;
//! Value of the current time
doublereal m_tcurrent;
double m_tcurrent = 0;
//! Value of deltaT for the current step
doublereal m_deltat;
double m_deltat = 0.0;
//! maximum number of error test failures
int m_maxErrTestFails;
int m_maxErrTestFails = -1;
//! Maximum number of nonlinear solver iterations at one solution
/*!
* If zero, this is the default of 4.
*/
int m_maxNonlinIters;
int m_maxNonlinIters = 0;
//! Maximum number of nonlinear convergence failures
int m_maxNonlinConvFails;
int m_maxNonlinConvFails = -1;
//! If true, the algebraic variables don't contribute to error tolerances
int m_setSuppressAlg;
int m_setSuppressAlg = 0;
std::unique_ptr<ResidData> m_fdata;
int m_mupper;
int m_mlower;
int m_mupper = 0;
int m_mlower = 0;
};
}

View File

@ -85,15 +85,24 @@ public:
protected:
void _init(size_t n);
StFlow* m_flow_left, *m_flow_right;
size_t m_ilr, m_left_nv, m_right_nv;
size_t m_left_loc, m_right_loc;
size_t m_left_points;
size_t m_left_nsp, m_right_nsp;
size_t m_sp_left, m_sp_right;
size_t m_start_left, m_start_right;
ThermoPhase* m_phase_left, *m_phase_right;
double m_temp, m_mdot;
StFlow* m_flow_left = nullptr;
StFlow* m_flow_right = nullptr;
size_t m_ilr = 0;
size_t m_left_nv = 0;
size_t m_right_nv = 0;
size_t m_left_loc = 0;
size_t m_right_loc = 0;
size_t m_left_points = 0;
size_t m_left_nsp = 0;
size_t m_right_nsp = 0;
size_t m_sp_left = 0;
size_t m_sp_right = 0;
size_t m_start_left = 0;
size_t m_start_right = 0;
ThermoPhase* m_phase_left = nullptr;
ThermoPhase* m_phase_right = nullptr;
double m_temp = 0.0;
double m_mdot = 0.0;
};
@ -135,11 +144,11 @@ public:
protected:
int m_ilr;
double m_V0;
size_t m_nsp;
double m_V0 = 0.0;
size_t m_nsp = 0;
vector_fp m_yin;
std::string m_xstr;
StFlow* m_flow;
StFlow* m_flow = nullptr;
};
/**
@ -149,7 +158,7 @@ protected:
class Empty1D : public Boundary1D
{
public:
Empty1D() : Boundary1D() {
Empty1D() {
m_type = cEmptyType;
}
@ -177,7 +186,7 @@ public:
class Symm1D : public Boundary1D
{
public:
Symm1D() : Boundary1D() {
Symm1D() {
m_type = cSymmType;
}
@ -203,7 +212,7 @@ public:
class Outlet1D : public Boundary1D
{
public:
Outlet1D() : Boundary1D() {
Outlet1D() {
m_type = cOutletType;
}
@ -251,10 +260,10 @@ public:
virtual void restore(SolutionArray& arr, double* soln, int loglevel);
protected:
size_t m_nsp;
size_t m_nsp = 0;
vector_fp m_yres;
std::string m_xstr;
StFlow* m_flow;
StFlow* m_flow = nullptr;
};
/**
@ -266,7 +275,7 @@ protected:
class Surf1D : public Boundary1D
{
public:
Surf1D() : Boundary1D() {
Surf1D() {
m_type = cSurfType;
}
@ -333,10 +342,11 @@ public:
virtual void showSolution(const double* x);
protected:
InterfaceKinetics* m_kin;
SurfPhase* m_sphase;
size_t m_surfindex, m_nsp;
bool m_enabled;
InterfaceKinetics* m_kin = nullptr;
SurfPhase* m_sphase = nullptr;
size_t m_surfindex = 0;
size_t m_nsp = 0;
bool m_enabled = false;
vector_fp m_work;
vector_fp m_fixed_cov;
};

View File

@ -535,8 +535,8 @@ protected:
//! Retrieve meta data
virtual void setMeta(const AnyMap& meta, int loglevel);
doublereal m_rdt;
size_t m_nv;
double m_rdt = 0.0;
size_t m_nv = 0;
size_t m_points;
vector_fp m_slast;
vector_fp m_max;
@ -544,27 +544,28 @@ protected:
vector_fp m_rtol_ss, m_rtol_ts;
vector_fp m_atol_ss, m_atol_ts;
vector_fp m_z;
OneDim* m_container;
OneDim* m_container = nullptr;
size_t m_index;
int m_type;
int m_type = 0;
//! Starting location within the solution vector for unknowns that
//! correspond to this domain
/*!
* Remember there may be multiple domains associated with this problem
*/
size_t m_iloc;
size_t m_iloc = 0;
size_t m_jstart;
size_t m_jstart = 0;
Domain1D* m_left, *m_right;
Domain1D* m_left = nullptr;
Domain1D* m_right = nullptr;
//! Identity tag for the domain
std::string m_id;
std::unique_ptr<Refiner> m_refiner;
std::vector<std::string> m_name;
int m_bw;
bool m_force_full_update;
int m_bw = -1;
bool m_force_full_update = false;
//! Composite thermo/kinetics/transport handler
shared_ptr<Solution> m_solution;

View File

@ -88,7 +88,7 @@ protected:
std::vector<bool> m_do_electric_field;
//! flag for importing transport of electron
bool m_import_electron_transport;
bool m_import_electron_transport = false;
//! electrical properties
vector_fp m_speciesCharge;
@ -107,10 +107,10 @@ protected:
vector_fp m_mobility;
//! solving stage
size_t m_stage;
size_t m_stage = 1;
//! index of electron
size_t m_kElectron;
size_t m_kElectron = npos;
//! electric field
double E(const double* x, size_t j) const {

View File

@ -74,12 +74,13 @@ protected:
OneDim* m_resid;
vector_fp m_r1;
doublereal m_rtol, m_atol;
doublereal m_elapsed;
double m_rtol = 1e-5;
double m_atol = sqrt(std::numeric_limits<double>::epsilon());
double m_elapsed = 0.0;
vector_fp m_ssdiag;
vector_int m_mask;
int m_nevals;
int m_age;
int m_nevals = 0;
int m_age = 100000;
size_t m_size;
size_t m_points;
};

View File

@ -76,12 +76,12 @@ protected:
//! Work arrays of size #m_n used in solve().
vector_fp m_x, m_stp, m_stp1;
int m_maxAge;
int m_maxAge = 5;
//! number of variables
size_t m_n;
doublereal m_elapsed;
double m_elapsed = 0.0;
};
}

View File

@ -325,47 +325,48 @@ public:
protected:
void evalSSJacobian(doublereal* x, doublereal* xnew);
doublereal m_tmin; //!< minimum timestep size
doublereal m_tmax; //!< maximum timestep size
double m_tmin = 1e-16; //!< minimum timestep size
double m_tmax = 1e+08; //!< maximum timestep size
//! factor time step is multiplied by if time stepping fails ( < 1 )
doublereal m_tfactor;
double m_tfactor = 0.5;
std::unique_ptr<MultiJac> m_jac; //!< Jacobian evaluator
std::unique_ptr<MultiNewton> m_newt; //!< Newton iterator
doublereal m_rdt; //!< reciprocal of time step
bool m_jac_ok; //!< if true, Jacobian is current
double m_rdt = 0.0; //!< reciprocal of time step
bool m_jac_ok = false; //!< if true, Jacobian is current
size_t m_bw; //!< Jacobian bandwidth
size_t m_size; //!< solution vector size
size_t m_bw = 0; //!< Jacobian bandwidth
size_t m_size = 0; //!< solution vector size
std::vector<Domain1D*> m_dom, m_connect, m_bulk;
bool m_init;
bool m_init = false;
std::vector<size_t> m_nvars;
std::vector<size_t> m_loc;
vector_int m_mask;
size_t m_pts;
size_t m_pts = 0;
// options
int m_ss_jac_age, m_ts_jac_age;
int m_ss_jac_age = 20;
int m_ts_jac_age = 20;
//! Function called at the start of every call to #eval.
Func1* m_interrupt;
Func1* m_interrupt = nullptr;
//! User-supplied function called after each successful timestep.
Func1* m_time_step_callback;
Func1* m_time_step_callback = nullptr;
//! Number of time steps taken in the current call to solve()
int m_nsteps;
int m_nsteps = 0;
//! Maximum number of timesteps allowed per call to solve()
int m_nsteps_max;
int m_nsteps_max = 500;
private:
// statistics
int m_nevals;
doublereal m_evaltime;
int m_nevals = 0;
double m_evaltime = 0;
std::vector<size_t> m_gridpts;
vector_int m_jacEvals;
vector_fp m_jacElapsed;

View File

@ -414,7 +414,7 @@ protected:
// member data
//---------------------------------------------------------
doublereal m_press; // pressure
double m_press = -1.0; // pressure
// grid parameters
vector_fp m_dz;
@ -440,13 +440,13 @@ protected:
size_t m_nsp;
IdealGasPhase* m_thermo;
Kinetics* m_kin;
Transport* m_trans;
IdealGasPhase* m_thermo = nullptr;
Kinetics* m_kin = nullptr;
Transport* m_trans = nullptr;
// boundary emissivities for the radiation calculations
doublereal m_epsilon_left;
doublereal m_epsilon_right;
double m_epsilon_left = 0.0;
double m_epsilon_right = 0.0;
//! Indices within the ThermoPhase of the radiating species. First index is
//! for CO2, second is for H2O.
@ -454,12 +454,12 @@ protected:
// flags
std::vector<bool> m_do_energy;
bool m_do_soret;
bool m_do_soret = false;
std::vector<bool> m_do_species;
bool m_do_multicomponent;
bool m_do_multicomponent = false;
//! flag for the radiative heat loss
bool m_do_radiation;
bool m_do_radiation = false;
//! radiative heat loss vector
vector_fp m_qdotRadiation;
@ -472,8 +472,8 @@ protected:
//! Index of species with a large mass fraction at each boundary, for which
//! the mass fraction may be calculated as 1 minus the sum of the other mass
//! fractions
size_t m_kExcessLeft;
size_t m_kExcessRight;
size_t m_kExcessLeft = 0;
size_t m_kExcessRight = 0;
bool m_dovisc;
@ -483,10 +483,10 @@ protected:
public:
//! Location of the point where temperature is fixed
double m_zfixed;
double m_zfixed = Undef;
//! Temperature at the point used to fix the flame location
double m_tfixed;
double m_tfixed = -1.0;
private:
vector_fp m_ybar;

View File

@ -103,12 +103,16 @@ protected:
//! Names of components that require the addition of new grid points
set<string> m_c;
std::vector<bool> m_active;
doublereal m_ratio, m_slope, m_curve, m_prune;
doublereal m_min_range;
double m_ratio = 10.0;
double m_slope = 0.8;
double m_curve = 0.8;
double m_prune = -0.001;
double m_min_range = 0.01;
Domain1D* m_domain;
size_t m_nv, m_npmax;
doublereal m_thresh;
doublereal m_gridmin; //!< minimum grid spacing [m]
size_t m_nv;
size_t m_npmax = 1000;
double m_thresh = std::sqrt(std::numeric_limits<double>::epsilon());
double m_gridmin = 1e-10; //!< minimum grid spacing [m]
};
}

View File

@ -238,7 +238,7 @@ protected:
void diff(const vector_fp& inputData, vector_fp& derivedData) const;
//! Current tabulated species index
size_t m_kk_tab;
size_t m_kk_tab = npos;
//! Tabulated contribution to h0[m_kk_tab] at the current composition
mutable double m_h0_tab;

View File

@ -103,17 +103,17 @@ public:
protected:
//! Base temperature
doublereal m_t0;
double m_t0 = 0.0;
//! Dimensionless value of the heat capacity
doublereal m_cp0_R;
double m_cp0_R = 0.0;
//! dimensionless value of the enthaply at t0
doublereal m_h0_R;
double m_h0_R = 0.0;
//! Dimensionless value of the entropy at t0
doublereal m_s0_R;
double m_s0_R = 0.0;
//! log of the t0 value
doublereal m_logt0;
double m_logt0 = 0.0;
//! Original value of h0_R, restored by calling resetHf298()
double m_h0_R_orig;
double m_h0_R_orig = 0.0;
};
}

View File

@ -793,7 +793,7 @@ protected:
* DHFORM_BETAIJ = 3
* DHFORM_PITZER_BETAIJ = 4
*/
int m_formDH;
int m_formDH = DHFORM_DILUTE_LIMIT;
//! Vector containing the electrolyte species type
/*!
@ -812,10 +812,10 @@ protected:
vector_fp m_Aionic;
//! Default ionic radius for species where it is not specified
double m_Aionic_default;
double m_Aionic_default = NAN;
//! Current value of the ionic strength on the molality scale
mutable double m_IionicMolality;
mutable double m_IionicMolality = 0.0;
//! Maximum value of the ionic strength allowed in the calculation of the
//! activity coefficients.
@ -826,10 +826,10 @@ public:
//! instead of the rigorous form obtained from Gibbs-Duhem relation. This
//! should be used with caution, and is really only included as a validation
//! exercise.
bool m_useHelgesonFixedForm;
bool m_useHelgesonFixedForm = false;
protected:
//! Stoichiometric ionic strength on the molality scale
mutable double m_IionicMolalityStoich;
mutable double m_IionicMolalityStoich = 0.0;
public:
/**
@ -848,7 +848,7 @@ public:
* strong function of T, and its variability must be
* accounted for,
*/
int m_form_A_Debye;
int m_form_A_Debye = A_DEBYE_CONST;
protected:
//! Current value of the Debye Constant, A_Debye
@ -902,13 +902,13 @@ protected:
/*!
* derived from the equation of state for water.
*/
PDSS_Water* m_waterSS;
PDSS_Water* m_waterSS = nullptr;
//! Storage for the density of water's standard state
/*!
* Density depends on temperature and pressure.
*/
double m_densWaterSS;
double m_densWaterSS = 1000.0;
//! Pointer to the water property calculator
std::unique_ptr<WaterProps> m_waterProps;

View File

@ -1387,19 +1387,19 @@ private:
* PITZER_TEMP_LINEAR 1
* PITZER_TEMP_COMPLEX1 2
*/
int m_formPitzerTemp;
int m_formPitzerTemp = PITZER_TEMP_CONSTANT;
//! Current value of the ionic strength on the molality scale Associated
//! Salts, if present in the mechanism, don't contribute to the value of the
//! ionic strength in this version of the Ionic strength.
mutable double m_IionicMolality;
mutable double m_IionicMolality = 0.0;
//! Maximum value of the ionic strength allowed in the calculation of the
//! activity coefficients.
double m_maxIionicStrength;
//! Reference Temperature for the Pitzer formulations.
double m_TempPitzerRef;
double m_TempPitzerRef = 298.15;
public:
/**
@ -1416,7 +1416,7 @@ public:
* water is a relatively strong function of T, and its variability must be
* accounted for,
*/
int m_form_A_Debye;
int m_form_A_Debye = A_DEBYE_CONST;
private:
/**
@ -1454,7 +1454,7 @@ private:
/*!
* derived from the equation of state for water.
*/
PDSS* m_waterSS;
PDSS* m_waterSS = nullptr;
//! Pointer to the water property calculator
std::unique_ptr<WaterProps> m_waterProps;
@ -1772,7 +1772,7 @@ private:
mutable vector_fp m_molalitiesCropped;
//! Boolean indicating whether the molalities are cropped or are modified
mutable bool m_molalitiesAreCropped;
mutable bool m_molalitiesAreCropped = false;
//! a counter variable for keeping track of symmetric binary
//! interactions amongst the solute species.
@ -1900,41 +1900,41 @@ private:
//! value of the solute mole fraction that centers the cutoff polynomials
//! for the cutoff =1 process;
doublereal IMS_X_o_cutoff_;
double IMS_X_o_cutoff_ = 0.2;
//! Parameter in the polyExp cutoff treatment having to do with rate of exp decay
doublereal IMS_cCut_;
double IMS_cCut_ = 0.05;
//! Parameter in the polyExp cutoff treatment
/*!
* This is the slope of the g function at the zero solvent point
* Default value is 0.0
*/
doublereal IMS_slopegCut_;
double IMS_slopegCut_ = 0.0;
//! @name Parameters in the polyExp cutoff treatment having to do with rate of exp decay
//! @{
doublereal IMS_dfCut_;
doublereal IMS_efCut_;
doublereal IMS_afCut_;
doublereal IMS_bfCut_;
doublereal IMS_dgCut_;
doublereal IMS_egCut_;
doublereal IMS_agCut_;
doublereal IMS_bgCut_;
double IMS_dfCut_ = 0.0;
double IMS_efCut_ = 0.0;
double IMS_afCut_ = 0.0;
double IMS_bfCut_ = 0.0;
double IMS_dgCut_ = 0.0;
double IMS_egCut_ = 0.0;
double IMS_agCut_ = 0.0;
double IMS_bgCut_ = 0.0;
//! @}
//! value of the solvent mole fraction that centers the cutoff polynomials
//! for the cutoff =1 process;
doublereal MC_X_o_cutoff_;
double MC_X_o_cutoff_ = 0.0;
//! @name Parameters in the Molality Exp cutoff treatment
//! @{
doublereal MC_dpCut_;
doublereal MC_epCut_;
doublereal MC_apCut_;
doublereal MC_bpCut_;
doublereal MC_cpCut_;
double MC_dpCut_ = 0.0;
double MC_epCut_ = 0.0;
double MC_apCut_ = 0.0;
double MC_bpCut_ = 0.0;
double MC_cpCut_ = 0.0;
doublereal CROP_ln_gamma_o_min;
doublereal CROP_ln_gamma_o_max;
doublereal CROP_ln_gamma_k_min;
@ -2060,7 +2060,7 @@ private:
* @param is Ionic strength
*/
void calc_lambdas(double is) const;
mutable doublereal m_last_is;
mutable double m_last_is = -1.0;
/**
* Calculate etheta and etheta_prime

View File

@ -559,7 +559,7 @@ protected:
* Value of the reference state pressure in Pascals.
* All species must have the same reference state pressure.
*/
doublereal m_p0;
double m_p0 = -1.0;
//! Temporary storage for dimensionless reference state enthalpies
mutable vector_fp m_h0_RT;

View File

@ -417,10 +417,10 @@ protected:
* 0 = 'unity', 1 = 'species-molar-volume', 2 = 'solvent-molar-volume'. See
* setStandardConcentrationModel().
*/
int m_formGC;
int m_formGC = 2;
//! Cutoff type
int IMS_typeCutoff_;
int IMS_typeCutoff_ = 0;
private:
//! vector of size m_kk, used as a temporary holding area.
@ -452,15 +452,15 @@ public:
//! @name Parameters in the polyExp cutoff having to do with rate of exp decay
//! @{
doublereal IMS_cCut_;
doublereal IMS_dfCut_;
doublereal IMS_efCut_;
doublereal IMS_afCut_;
doublereal IMS_bfCut_;
doublereal IMS_dgCut_;
doublereal IMS_egCut_;
doublereal IMS_agCut_;
doublereal IMS_bgCut_;
double IMS_cCut_;
double IMS_dfCut_ = 0.0;
double IMS_efCut_ = 0.0;
double IMS_afCut_ = 0.0;
double IMS_bfCut_ = 0.0;
double IMS_dgCut_ = 0.0;
double IMS_egCut_ = 0.0;
double IMS_agCut_ = 0.0;
double IMS_bgCut_ = 0.0;
//! @}
private:

View File

@ -575,7 +575,7 @@ protected:
* 0 = 'unity', 1 = 'species-molar-volume', 2 = 'solvent-molar-volume'. See
* setStandardConcentrationModel().
*/
int m_formGC;
int m_formGC = 0;
/**
* Value of the reference pressure for all species in this phase. The T
@ -583,7 +583,7 @@ protected:
* because this is a single value, all species are required to have the same
* reference pressure.
*/
doublereal m_Pref;
double m_Pref = OneAtm;
/**
* m_Pcurrent = The current pressure
@ -592,7 +592,7 @@ protected:
* The density variable which is inherited as part of the State class,
* m_dens, is always kept current whenever T, P, or X[] change.
*/
doublereal m_Pcurrent;
double m_Pcurrent = OneAtm;
//! Vector of molar volumes for each species in the solution
/**

View File

@ -144,7 +144,7 @@ protected:
* - 1 1/V_k
* - 2 1/V_0
*/
int m_formGC;
int m_formGC = 0;
//! Temporary storage - length = m_kk.
vector_fp m_pp;

View File

@ -319,17 +319,17 @@ protected:
*
* Defaults to cIonSolnType_SINGLEANION, so that LiKCl can be hardwired
*/
IonSolnType_enumType ionSolnType_;
IonSolnType_enumType ionSolnType_ = cIonSolnType_SINGLEANION;
//! Number of neutral molecule species
/*!
* This is equal to the number of species in the neutralMoleculePhase_
* ThermoPhase.
*/
size_t numNeutralMoleculeSpecies_;
size_t numNeutralMoleculeSpecies_ = 0;
//! Index of special species
size_t indexSpecialSpecies_;
size_t indexSpecialSpecies_ = npos;
//! Formula Matrix for composition of neutral molecules
//! in terms of the molecules in this ThermoPhase

View File

@ -563,7 +563,7 @@ protected:
virtual void compositionChanged();
//! Reference state pressure
doublereal m_Pref;
double m_Pref = OneAtm;
//! The current pressure
/*!
@ -572,7 +572,7 @@ protected:
* variable which is inherited as part of the State class, m_dens, is always
* kept current whenever T, P, or X[] change.
*/
doublereal m_Pcurrent;
double m_Pcurrent = OneAtm;
//! Reference state enthalpies / RT
mutable vector_fp m_h0_RT;
@ -599,7 +599,7 @@ protected:
*
* units are kmol m-3
*/
doublereal m_site_density;
double m_site_density = 0.0;
private:
//! Update the species reference state thermodynamic functions

View File

@ -105,7 +105,7 @@ class LatticeSolidPhase : public ThermoPhase
{
public:
//! Base empty constructor
LatticeSolidPhase();
LatticeSolidPhase() = default;
virtual std::string type() const {
return "LatticeSolid";
@ -451,10 +451,10 @@ public:
protected:
//! Current value of the pressure
doublereal m_press;
double m_press = -1.0;
//! Current value of the molar density
doublereal m_molar_density;
double m_molar_density = 0.0;
//! Vector of sublattic ThermoPhase objects
std::vector<shared_ptr<ThermoPhase>> m_lattice;

View File

@ -415,7 +415,7 @@ private:
protected:
//! number of binary interaction expressions
size_t numBinaryInteractions_;
size_t numBinaryInteractions_ = 0;
//! Enthalpy term for the binary mole fraction interaction of the
//! excess Gibbs free energy expression
@ -467,13 +467,13 @@ protected:
/*!
* Currently there is only one form.
*/
int formMargules_;
int formMargules_ = 0;
//! form of the temperature dependence of the Margules interaction expression
/*!
* Currently there is only one form -> constant wrt temperature.
*/
int formTempModel_;
int formTempModel_ = 0;
};
}

View File

@ -27,7 +27,7 @@ namespace Cantera
class MaskellSolidSolnPhase : public VPStandardStateTP
{
public:
MaskellSolidSolnPhase();
MaskellSolidSolnPhase() = default;
virtual std::string type() const {
return "MaskellSolidsoln";
@ -113,15 +113,15 @@ private:
* pressure, but only of the mole fractions, we need to independently
* specify the pressure.
*/
doublereal m_Pcurrent;
double m_Pcurrent = OneAtm;
//! Value of the enthalpy change on mixing due to protons changing from type
//! B to type A configurations.
doublereal h_mixing;
double h_mixing = 0.0;
//! Index of the species whose mole fraction defines the extent of reduction r
int product_species_index;
int reactant_species_index;
int product_species_index = -1;
int reactant_species_index = -1;
// Functions to calculate some of the pieces of the mixing terms.
doublereal s() const;

View File

@ -78,7 +78,7 @@ public:
//! @{
//! Constructor.
MixtureFugacityTP();
MixtureFugacityTP() = default;
//! @}
//! @name Utilities
@ -557,10 +557,10 @@ protected:
* - FLUID_LIQUID
* - FLUID_SUPERCRIT
*/
int iState_;
int iState_ = FLUID_GAS;
//! Force the system to be on a particular side of the spinodal curve
int forcedState_;
int forcedState_ = FLUID_UNDEFINED;
//! Temporary storage for dimensionless reference state enthalpies
mutable vector_fp m_h0_RT;

View File

@ -23,6 +23,51 @@
namespace Cantera
{
//! Scale to be used for the output of single-ion activity coefficients is that
//! used by Pitzer.
/*!
* This is the internal scale used within the code. One property is that the
* activity coefficients for the cation and anion of a single salt will be
* equal. This scale is the one presumed by the formulation of the single-ion
* activity coefficients described in this report.
*
* Activity coefficients for species k may be altered between scales s1 to s2
* using the following formula
*
* \f[
* ln(\gamma_k^{s2}) = ln(\gamma_k^{s1})
* + \frac{z_k}{z_j} \left( ln(\gamma_j^{s2}) - ln(\gamma_j^{s1}) \right)
* \f]
*
* where j is any one species.
*/
const int PHSCALE_PITZER = 0;
//! Scale to be used for evaluation of single-ion activity coefficients is that
//! used by the NBS standard for evaluation of the pH variable.
/*!
* This is not the internal scale used within the code.
*
* Activity coefficients for species k may be altered between scales s1 to s2
* using the following formula
*
* \f[
* ln(\gamma_k^{s2}) = ln(\gamma_k^{s1})
* + \frac{z_k}{z_j} \left( ln(\gamma_j^{s2}) - ln(\gamma_j^{s1}) \right)
* \f]
*
* where j is any one species. For the NBS scale, j is equal to the Cl- species
* and
*
* \f[
* ln(\gamma_{Cl-}^{s2}) = \frac{-A_{\phi} \sqrt{I}}{1.0 + 1.5 \sqrt{I}}
* \f]
*
* This is the NBS pH scale, which is used in all conventional pH measurements.
* and is based on the Bates-Guggenheim equations.
*/
const int PHSCALE_NBS = 1;
/*!
* MolalityVPSSTP is a derived class of ThermoPhase that handles variable
* pressure standard state methods for calculating thermodynamic properties that
@ -545,17 +590,17 @@ protected:
* the identity of the Cl- species for the PHSCALE_NBS scaling. Either
* PHSCALE_PITZER or PHSCALE_NBS
*/
int m_pHScalingType;
int m_pHScalingType = PHSCALE_PITZER;
//! Index of the phScale species
/*!
* Index of the species to be used in the single-ion scaling law. This is
* the identity of the Cl- species for the PHSCALE_NBS scaling
*/
size_t m_indexCLM;
size_t m_indexCLM = npos;
//! Molecular weight of the Solvent
doublereal m_weightSolvent;
double m_weightSolvent = 18.01528;
/*!
* In any molality implementation, it makes sense to have a minimum solvent
@ -564,64 +609,18 @@ protected:
* the molality definition to ensure that molal_solvent = 0 when
* xmol_solvent = 0.
*/
doublereal m_xmolSolventMIN;
double m_xmolSolventMIN = 0.01;
//! This is the multiplication factor that goes inside log expressions
//! involving the molalities of species. It's equal to Wt_0 / 1000, where
//! Wt_0 = weight of solvent (kg/kmol)
doublereal m_Mnaught;
double m_Mnaught = 18.01528E-3;
//! Current value of the molalities of the species in the phase. Note this
//! vector is a mutable quantity. units are (kg/kmol)
mutable vector_fp m_molalities;
};
//! Scale to be used for the output of single-ion activity coefficients is that
//! used by Pitzer.
/*!
* This is the internal scale used within the code. One property is that the
* activity coefficients for the cation and anion of a single salt will be
* equal. This scale is the one presumed by the formulation of the single-ion
* activity coefficients described in this report.
*
* Activity coefficients for species k may be altered between scales s1 to s2
* using the following formula
*
* \f[
* ln(\gamma_k^{s2}) = ln(\gamma_k^{s1})
* + \frac{z_k}{z_j} \left( ln(\gamma_j^{s2}) - ln(\gamma_j^{s1}) \right)
* \f]
*
* where j is any one species.
*/
const int PHSCALE_PITZER = 0;
//! Scale to be used for evaluation of single-ion activity coefficients is that
//! used by the NBS standard for evaluation of the pH variable.
/*!
* This is not the internal scale used within the code.
*
* Activity coefficients for species k may be altered between scales s1 to s2
* using the following formula
*
* \f[
* ln(\gamma_k^{s2}) = ln(\gamma_k^{s1})
* + \frac{z_k}{z_j} \left( ln(\gamma_j^{s2}) - ln(\gamma_j^{s1}) \right)
* \f]
*
* where j is any one species. For the NBS scale, j is equal to the Cl- species
* and
*
* \f[
* ln(\gamma_{Cl-}^{s2}) = \frac{-A_{\phi} \sqrt{I}}{1.0 + 1.5 \sqrt{I}}
* \f]
*
* This is the NBS pH scale, which is used in all conventional pH measurements.
* and is based on the Bates-Guggenheim equations.
*/
const int PHSCALE_NBS = 1;
}
#endif

View File

@ -140,11 +140,11 @@ public:
protected:
//! Number of intervals in the interpolating linear approximation. Number
//! of points is one more than the number of intervals.
size_t m_numIntervals;
size_t m_numIntervals = 0;
//! Value of the enthalpy at T = 298.15. This value is tied to the Heat of
//! formation of the species at 298.15.
doublereal m_H298;
double m_H298 = 0.0;
//! Points at which the standard state chemical potential are given.
vector_fp m_t0_int;

View File

@ -47,12 +47,12 @@ class MultiSpeciesThermo
{
public:
//! Constructor
MultiSpeciesThermo();
MultiSpeciesThermo() = default;
// MultiSpeciesThermo objects are not copyable or assignable
MultiSpeciesThermo(const MultiSpeciesThermo& b) = delete;
MultiSpeciesThermo& operator=(const MultiSpeciesThermo& b) = delete;
virtual ~MultiSpeciesThermo() {}
virtual ~MultiSpeciesThermo() = default;
//! Install a new species thermodynamic property parameterization for one
//! species.
@ -220,13 +220,13 @@ protected:
std::map<size_t, std::pair<int, size_t> > m_speciesLoc;
//! Maximum value of the lowest temperature
doublereal m_tlow_max;
double m_tlow_max = 0.0;
//! Minimum value of the highest temperature
doublereal m_thigh_min;
double m_thigh_min = 1e+30;
//! reference pressure (Pa)
doublereal m_p0;
double m_p0 = OneAtm;
//! indicates if data for species has been installed
std::vector<bool> m_installed;

View File

@ -36,7 +36,7 @@ namespace Cantera
class Nasa9PolyMultiTempRegion : public SpeciesThermoInterpType
{
public:
Nasa9PolyMultiTempRegion();
Nasa9PolyMultiTempRegion() = default;
//! Constructor with all input data
/*!
@ -76,8 +76,6 @@ public:
*/
void setParameters(const std::map<double, vector_fp>& regions);
virtual ~Nasa9PolyMultiTempRegion();
virtual int reportType() const;
virtual size_t temperaturePolySize() const { return 7; }
@ -128,7 +126,7 @@ protected:
std::vector<std::unique_ptr<Nasa9Poly1>> m_regionPts;
//! current region
mutable int m_currRegion;
mutable int m_currRegion = 0;
};
}

View File

@ -48,7 +48,7 @@ namespace Cantera
class NasaPoly2 : public SpeciesThermoInterpType
{
public:
NasaPoly2();
NasaPoly2() = default;
//! Constructor with all input data
/*!
@ -169,7 +169,7 @@ public:
protected:
//! Midrange temperature
doublereal m_midT;
double m_midT = 0.0;
//! NasaPoly1 object for the low temperature region.
NasaPoly1 mnp_low;
//! NasaPoly1 object for the high temperature region.

View File

@ -150,12 +150,12 @@ public:
//! @{
//! Default Constructor
PDSS();
PDSS() = default;
// PDSS objects are not copyable or assignable
PDSS(const PDSS& b) = delete;
PDSS& operator=(const PDSS& b) = delete;
virtual ~PDSS() {}
virtual ~PDSS() = default;
//! @}
//! @name Molar Thermodynamic Properties of the Species Standard State
@ -449,22 +449,22 @@ public:
protected:
//! Current temperature used by the PDSS object
mutable doublereal m_temp;
mutable double m_temp = -1.0;
//! State of the system - pressure
mutable doublereal m_pres;
mutable double m_pres = -1.0;
//! Reference state pressure of the species.
doublereal m_p0;
double m_p0 = -1.0;
//! Minimum temperature
doublereal m_minTemp;
double m_minTemp = -1.0;
//! Maximum temperature
doublereal m_maxTemp;
double m_maxTemp = 10000.0;
//! Molecular Weight of the species
doublereal m_mw;
double m_mw = 0.0;
//! Input data supplied via setParameters. This may include parameters for
//! different phase models, which will be used when initThermo() is called.

View File

@ -258,12 +258,12 @@ private:
* derived from the equation of state for water.
* This object doesn't own the object. Just a shallow pointer.
*/
PDSS_Water* m_waterSS;
PDSS_Water* m_waterSS = nullptr;
UnitSystem m_units;
//! density of standard-state water. internal temporary variable
mutable doublereal m_densWaterSS;
mutable double m_densWaterSS = -1.0;
//! Pointer to the water property calculator
std::unique_ptr<WaterProps> m_waterProps;
@ -275,7 +275,7 @@ private:
* This is the delta G for the formation reaction of the
* ion from elements in their stable state at Tr, Pr.
*/
doublereal m_deltaG_formation_tr_pr;
double m_deltaG_formation_tr_pr = NAN;
//! Input value of deltaH of Formation at Tr and Pr (cal gmol-1)
/*!
@ -284,7 +284,7 @@ private:
* This is the delta H for the formation reaction of the
* ion from elements in their stable state at Tr, Pr.
*/
doublereal m_deltaH_formation_tr_pr;
double m_deltaH_formation_tr_pr = NAN;
//! Value of the Absolute Gibbs Free Energy NIST scale at T_r and P_r
/*!
@ -293,49 +293,49 @@ private:
*
* J kmol-1
*/
doublereal m_Mu0_tr_pr;
double m_Mu0_tr_pr = 0.0;
//! Input value of S_j at Tr and Pr (cal gmol-1 K-1)
/*!
* Tr = 298.15 Pr = 1 atm
*/
doublereal m_Entrop_tr_pr;
double m_Entrop_tr_pr = NAN;
//! Input a1 coefficient (cal gmol-1 bar-1)
doublereal m_a1;
double m_a1 = 0.0;
//! Input a2 coefficient (cal gmol-1)
doublereal m_a2;
double m_a2 = 0.0;
//! Input a3 coefficient (cal K gmol-1 bar-1)
doublereal m_a3;
double m_a3 = 0.0;
//! Input a4 coefficient (cal K gmol-1)
doublereal m_a4;
double m_a4 = 0.0;
//! Input c1 coefficient (cal gmol-1 K-1)
doublereal m_c1;
double m_c1 = 0.0;
//! Input c2 coefficient (cal K gmol-1)
doublereal m_c2;
double m_c2 = 0.0;
//! Input omega_pr_tr coefficient(cal gmol-1)
doublereal m_omega_pr_tr;
double m_omega_pr_tr = 0.0;
//! y = dZdT = 1/(esp*esp) desp/dT at 298.15 and 1 bar
doublereal m_Y_pr_tr;
double m_Y_pr_tr = 0.0;
//! Z = -1 / relEpsilon at 298.15 and 1 bar
doublereal m_Z_pr_tr;
double m_Z_pr_tr = 0.0;
//! Reference pressure is 1 atm in units of bar= 1.0132
doublereal m_presR_bar;
double m_presR_bar = OneAtm * 1.0E-5;
//! small value that is not quite zero
doublereal m_domega_jdT_prtr;
double m_domega_jdT_prtr = 0.0;
//! Charge of the ion
doublereal m_charge_j;
double m_charge_j = 0.0;
//! Static variable determining error exiting
/*!

View File

@ -36,7 +36,7 @@ class PDSS_IonsFromNeutral : public PDSS_Nondimensional
{
public:
//! Default constructor
PDSS_IonsFromNeutral();
PDSS_IonsFromNeutral() = default;
//! @name Molar Thermodynamic Properties of the Species Standard State
//! @{
@ -101,7 +101,7 @@ protected:
//! Number of neutral molecule species that make up the stoichiometric
//! vector for this species, in terms of calculating thermodynamic functions
size_t numMult_;
size_t numMult_ = 0;
//! Vector of species indices in the neutral molecule ThermoPhase
std::vector<size_t> idNeutralMoleculeVec;
@ -114,7 +114,7 @@ protected:
/*!
* This is true if this species is not the special species
*/
bool add2RTln2_;
bool add2RTln2_ = true;
//! Vector of length equal to the number of species in the neutral molecule phase
mutable vector_fp tmpNM;

View File

@ -180,7 +180,7 @@ private:
//! Enumerated data type describing the type of volume model
//! used to calculate the standard state volume of the species
SSVolume_Model volumeModel_;
SSVolume_Model volumeModel_ = SSVolume_Model::tpoly;
//! coefficients for the temperature representation
vector_fp TCoeff_;

View File

@ -175,7 +175,7 @@ private:
* Density is the independent variable here, but it's hidden behind the
* object's interface.
*/
doublereal m_dens;
double m_dens;
//! state of the fluid
/*!
@ -187,21 +187,21 @@ private:
* 4 WATER_UNSTABLEGAS
* @endcode
*/
int m_iState;
int m_iState = WATER_LIQUID;
/**
* Offset constants used to obtain consistency with the NIST database.
* This is added to all internal energy and enthalpy results.
* units = J kmol-1.
*/
doublereal EW_Offset;
double EW_Offset = 0.0;
/**
* Offset constant used to obtain consistency with NIST convention.
* This is added to all internal entropy results.
* units = J kmol-1 K-1.
*/
doublereal SW_Offset;
double SW_Offset = 0.0;
public:
/**
@ -210,7 +210,7 @@ public:
* a gas-phase answer is allowed. This is used to check the thermodynamic
* consistency with ideal-gas thermo functions for example.
*/
bool m_allowGasPhase;
bool m_allowGasPhase = false;
};
}

View File

@ -240,19 +240,19 @@ protected:
/*!
* `m_b` is a function of the mole fractions and species-specific b values.
*/
double m_b;
double m_b = 0.0;
//! Value of \f$a\f$ in the equation of state
/*!
* `m_a` depends only on the mole fractions.
*/
double m_a;
double m_a = 0.0;
//! Value of \f$\alpha\f$ in the equation of state
/*!
* `m_aAlpha_mix` is a function of the temperature and the mole fractions.
*/
double m_aAlpha_mix;
double m_aAlpha_mix = 0.0;
// Vectors required to store species-specific a_coeff, b_coeff, alpha, kappa
// and other derivatives. Length = m_kk.
@ -271,9 +271,9 @@ protected:
//! Explicitly-specified binary interaction parameters, to enable serialization
std::map<std::string, std::map<std::string, double>> m_binaryParameters;
int m_NSolns;
int m_NSolns = 0;
double m_Vroot[3];
double m_Vroot[3] = {0.0, 0.0, 0.0};
//! Temporary storage - length = m_kk.
mutable vector_fp m_pp;
@ -286,14 +286,14 @@ protected:
* Calculated at the current conditions. temperature and mole number kept
* constant
*/
mutable double m_dpdV;
mutable double m_dpdV = 0.0;
//! The derivative of the pressure with respect to the temperature
/*!
* Calculated at the current conditions. Total volume and mole number kept
* constant
*/
mutable double m_dpdT;
mutable double m_dpdT = 0.0;
//! Vector of derivatives of pressure with respect to mole number
/*!

View File

@ -106,9 +106,8 @@ class Species;
class Phase
{
public:
Phase(); //!< Default constructor.
virtual ~Phase();
Phase() = default; //!< Default constructor.
virtual ~Phase() = default;
// Phase objects are not copyable or assignable
Phase(const Phase&) = delete;
@ -937,11 +936,11 @@ protected:
//! should call the parent class method as well.
virtual void compositionChanged();
size_t m_kk; //!< Number of species in the phase.
size_t m_kk = 0; //!< Number of species in the phase.
//! Dimensionality of the phase. Volumetric phases have dimensionality 3
//! and surface phases have dimensionality 2.
size_t m_ndim;
size_t m_ndim = 3;
//! Atomic composition of the species. The number of atoms of element i
//! in species k is equal to m_speciesComp[k * m_mm + i]
@ -953,10 +952,10 @@ protected:
std::map<std::string, shared_ptr<Species> > m_species;
//! Flag determining behavior when adding species with an undefined element
UndefElement::behavior m_undefinedElementBehavior;
UndefElement::behavior m_undefinedElementBehavior = UndefElement::add;
//! Flag determining whether case sensitive species names are enforced
bool m_caseSensitiveSpecies;
bool m_caseSensitiveSpecies = false;
private:
//! Find lowercase species name in m_speciesIndices when case sensitive
@ -969,15 +968,15 @@ private:
//! to another value during the course of a calculation.
std::string m_name;
doublereal m_temp; //!< Temperature (K). This is an independent variable
double m_temp = 0.001; //!< Temperature (K). This is an independent variable
//! Density (kg m-3). This is an independent variable except in the case
//! of incompressible phases, where it has to be changed using the
//! assignDensity() method. For compressible substances, the pressure is
//! determined from this variable rather than other way round.
doublereal m_dens;
double m_dens = 0.001;
doublereal m_mmw; //!< mean molecular weight of the mixture (kg kmol-1)
double m_mmw = 0.0; //!< mean molecular weight of the mixture (kg kmol-1)
//! m_ym[k] = mole fraction of species k divided by the mean molecular
//! weight of mixture.
@ -996,7 +995,7 @@ private:
//! State Change variable. Whenever the mole fraction vector changes,
//! this int is incremented.
int m_stateNum;
int m_stateNum = -1;
//! Vector of the species names
std::vector<std::string> m_speciesNames;
@ -1007,7 +1006,7 @@ private:
//! Map of lower-case species names to indices
std::map<std::string, size_t> m_speciesLower;
size_t m_mm; //!< Number of elements.
size_t m_mm = 0; //!< Number of elements.
vector_fp m_atomicWeights; //!< element atomic weights (kg kmol-1)
vector_int m_atomicNumbers; //!< element atomic numbers
std::vector<std::string> m_elementNames; //!< element names

View File

@ -304,10 +304,10 @@ protected:
void normalizeElectronEnergyDistribution();
// Electron energy order in the exponential term
double m_isotropicShapeFactor;
double m_isotropicShapeFactor = 2.0;
//! Number of points of electron energy levels
size_t m_nPoints;
size_t m_nPoints = 1001;
//! electron energy levels [ev]. Length: #m_nPoints
Eigen::ArrayXd m_electronEnergyLevels;
@ -317,19 +317,19 @@ protected:
Eigen::ArrayXd m_electronEnergyDist;
//! Index of electron species
size_t m_electronSpeciesIndex;
size_t m_electronSpeciesIndex = npos;
//! Electron temperature [K]
double m_electronTemp;
//! Electron energy distribution type
std::string m_distributionType;
string m_distributionType = "isotropic";
//! Numerical quadrature method for electron energy distribution
std::string m_quadratureMethod;
string m_quadratureMethod = "simpson";
//! Flag of normalizing electron energy distribution
bool m_do_normalizeElectronEnergyDist;
bool m_do_normalizeElectronEnergyDist = true;
};
}

View File

@ -31,7 +31,7 @@ class PureFluidPhase : public ThermoPhase
{
public:
//! Empty Base Constructor
PureFluidPhase();
PureFluidPhase() = default;
virtual std::string type() const {
return "PureFluid";
@ -211,17 +211,17 @@ private:
* The tpx package uses an int to indicate what fluid is being sought. Used
* only if #m_tpx_name is not set.
*/
int m_subflag;
int m_subflag = -1;
//! Name for this substance used by the TPX package. If this is not set,
//! #m_subflag is used instead.
std::string m_tpx_name;
//! Molecular weight of the substance (kg kmol-1)
doublereal m_mw;
double m_mw = -1.0;
//! flag to turn on some printing.
bool m_verbose;
bool m_verbose = false;
};
}

View File

@ -214,19 +214,19 @@ protected:
* - 0 = There is no temperature parameterization of a or b
* - 1 = The a_ij parameter is a linear function of the temperature
*/
int m_formTempParam;
int m_formTempParam = 0;
//! Value of b in the equation of state
/*!
* m_b is a function of the temperature and the mole fraction.
*/
doublereal m_b_current;
double m_b_current = 0.0;
//! Value of a in the equation of state
/*!
* a_b is a function of the temperature and the mole fraction.
*/
doublereal m_a_current;
double m_a_current = 0.0;
vector_fp a_vec_Curr_;
vector_fp b_vec_Curr_;
@ -240,9 +240,9 @@ protected:
//! For each species, specifies the source of the a and b coefficients
std::vector<CoeffSource> m_coeffSource;
int NSolns_;
int NSolns_ = 0;
doublereal Vroot_[3];
double Vroot_[3] = {0.0, 0.0, 0.0};
//! Temporary storage - length = m_kk.
mutable vector_fp m_pp;
@ -255,14 +255,14 @@ protected:
* Calculated at the current conditions. temperature and mole number kept
* constant
*/
mutable doublereal dpdV_;
mutable double dpdV_ = 0.0;
//! The derivative of the pressure wrt the temperature
/*!
* Calculated at the current conditions. Total volume and mole number kept
* constant
*/
mutable doublereal dpdT_;
mutable double dpdT_ = 0.0;
//! Vector of derivatives of pressure wrt mole number
/*!

View File

@ -57,7 +57,7 @@ class SingleSpeciesTP : public ThermoPhase
{
public:
//! Base empty constructor.
SingleSpeciesTP();
SingleSpeciesTP() = default;
virtual std::string type() const {
return "SingleSpecies";
@ -245,11 +245,11 @@ public:
protected:
//! The current pressure of the solution (Pa). It gets initialized to 1 atm.
doublereal m_press;
double m_press = OneAtm;
// Reference pressure (Pa). Must be the same for all species. Defaults to
// 1 atm.
doublereal m_p0;
double m_p0 = OneAtm;
//! Dimensionless enthalpy at the (mtlast, m_p0)
mutable double m_h0_RT;

View File

@ -24,7 +24,7 @@ class ThermoPhase;
class Species
{
public:
Species();
Species() = default;
//! Constructor
Species(const std::string& name, const compositionMap& comp,
@ -33,7 +33,7 @@ public:
//! Species objects are not copyable or assignable
Species(const Species&) = delete;
Species& operator=(const Species& other) = delete;
~Species();
~Species() = default;
AnyMap parameters(const ThermoPhase* phase=0, bool withInput=true) const;
@ -45,11 +45,11 @@ public:
compositionMap composition;
//! The electrical charge on the species, in units of the elementary charge.
double charge;
double charge = 0.0;
//! The effective size of the species. Currently used only for surface
//! species, where it represents the number of sites occupied.
double size;
double size = 1.0;
//! The molecular weight [amu] of the species.
/*!

View File

@ -112,7 +112,7 @@ class PDSS;
class SpeciesThermoInterpType
{
public:
SpeciesThermoInterpType();
SpeciesThermoInterpType() = default;
SpeciesThermoInterpType(double tlow, double thigh, double pref);
@ -120,7 +120,7 @@ public:
SpeciesThermoInterpType(const SpeciesThermoInterpType& b) = delete;
SpeciesThermoInterpType& operator=(const SpeciesThermoInterpType& b) = delete;
virtual ~SpeciesThermoInterpType() {}
virtual ~SpeciesThermoInterpType() = default;
//! Returns the minimum temperature that the thermo parameterization is
//! valid
@ -283,11 +283,11 @@ protected:
virtual void getParameters(AnyMap& thermo) const;
//! lowest valid temperature
doublereal m_lowT;
double m_lowT = 0.0;
//! Highest valid temperature
doublereal m_highT;
double m_highT = 0.0;
//! Reference state pressure
doublereal m_Pref;
double m_Pref = 0.0;
AnyMap m_input;
};

View File

@ -317,7 +317,7 @@ protected:
virtual void compositionChanged();
//! Surface site density (kmol m-2)
doublereal m_n0;
double m_n0 = 1.0;
//! Vector of species sizes (number of sites occupied). length m_kk.
vector_fp m_speciesSize;
@ -326,7 +326,7 @@ protected:
doublereal m_logn0;
//! Current value of the pressure (Pa)
doublereal m_press;
double m_press = OneAtm;
//! Temporary storage for the reference state enthalpies
mutable vector_fp m_h0;

View File

@ -102,7 +102,7 @@ class ThermoPhase : public Phase
public:
//! Constructor. Note that ThermoPhase is meant to be used as a base class,
//! so this constructor should not be called explicitly.
ThermoPhase();
ThermoPhase() = default;
//! @name Information Methods
//! @{
@ -1821,7 +1821,7 @@ protected:
AnyMap m_input;
//! Stored value of the electric potential for this phase. Units are Volts.
doublereal m_phi;
double m_phi = 0.0;
//! Boolean indicating whether a charge neutrality condition is a necessity
/*!
@ -1831,13 +1831,13 @@ protected:
* account. However, liquid phases usually require charge neutrality in
* order for their derived thermodynamics to be valid.
*/
bool m_chargeNeutralityNecessary;
bool m_chargeNeutralityNecessary = false;
//! Contains the standard state convention
int m_ssConvention;
int m_ssConvention = cSS_CONVENTION_TEMPERATURE;
//! last value of the temperature processed by reference state
mutable doublereal m_tlast;
mutable double m_tlast = 0.0;
};
}

View File

@ -265,21 +265,21 @@ protected:
*
* units = Pascals
*/
doublereal m_Pcurrent;
double m_Pcurrent = OneAtm;
//! The minimum temperature at which data for all species is valid
double m_minTemp;
double m_minTemp = 0.0;
//! The maximum temperature at which data for all species is valid
double m_maxTemp;
double m_maxTemp = BigNumber;
//! The last temperature at which the standard state thermodynamic
//! properties were calculated at.
mutable doublereal m_Tlast_ss;
mutable double m_Tlast_ss = -1.0;
//! The last pressure at which the Standard State thermodynamic properties
//! were calculated at.
mutable doublereal m_Plast_ss;
mutable double m_Plast_ss = -1.0;
//! Storage for the PDSS objects for the species
/*!

View File

@ -243,10 +243,10 @@ public:
protected:
//! Pointer to the WaterPropsIAPWS object
WaterPropsIAPWS* m_waterIAPWS;
WaterPropsIAPWS* m_waterIAPWS = nullptr;
//! true if we own the WaterPropsIAPWS object
bool m_own_sub;
bool m_own_sub = false;
};
//@}

View File

@ -162,7 +162,7 @@ class WaterPropsIAPWS
{
public:
//! Base constructor
WaterPropsIAPWS();
WaterPropsIAPWS() = default;
WaterPropsIAPWS(const WaterPropsIAPWS& right) = delete;
WaterPropsIAPWS& operator=(const WaterPropsIAPWS& right) = delete;
@ -477,13 +477,13 @@ private:
mutable WaterPropsIAPWSphi m_phi;
//! Dimensionless temperature, tau = T_C / T
doublereal tau;
double tau = -1.0;
//! Dimensionless density, delta = rho / rho_c
mutable doublereal delta;
mutable double delta = -1.0;
//! Current state of the system
mutable int iState;
mutable int iState = -30000;
};
}

View File

@ -188,13 +188,13 @@ protected:
doublereal DELTAp[16];
//! Last tau that was used to calculate polynomials
doublereal TAUsave;
double TAUsave = -1.0;
//! sqrt of TAU
doublereal TAUsqrt;
double TAUsqrt = -1.0;
//! Last delta that was used to calculate polynomials
doublereal DELTAsave;
double DELTAsave = -1.0;
};
} // namespace Cantera

View File

@ -201,24 +201,24 @@ private:
std::unique_ptr<WaterProps> m_waterProps;
//! Molecular weight of Water -> Cantera assumption
doublereal m_mw;
double m_mw = 0.0;
//! Offset constants used to obtain consistency with the NIST database.
/*!
* This is added to all internal energy and enthalpy results.
* units = J kmol-1.
*/
doublereal EW_Offset;
double EW_Offset = 0.0;
//! Offset constant used to obtain consistency with NIST convention.
/*!
* This is added to all internal entropy results.
* units = J kmol-1 K-1.
*/
doublereal SW_Offset;
double SW_Offset = 0.0;
//! Boolean is true if object has been properly initialized for calculation
bool m_ready;
bool m_ready = false;
/**
* Since this phase represents a liquid (or supercritical) phase, it is an
@ -226,7 +226,7 @@ private:
* a gas-phase answer is allowed. This is used to check the thermodynamic
* consistency with ideal-gas thermo functions for example.
*/
bool m_allowGasPhase;
bool m_allowGasPhase = false;
};
}

View File

@ -37,9 +37,9 @@ const double Undef = 999.1234;
class Substance
{
public:
Substance();
Substance() = default;
virtual ~Substance() {}
virtual ~Substance() = default;
void setStdState(double h0 = 0.0, double s0 = 0.0,
double t0 = 298.15, double p0 = 1.01325e5);
@ -175,11 +175,14 @@ public:
void Set(PropertyPair::type XY, double x0, double y0);
protected:
double T, Rho;
double Tslast, Rhf, Rhv;
double Pst;
double m_energy_offset;
double m_entropy_offset;
double T = Undef;
double Rho = Undef;
double Tslast = Undef;
double Rhf = Undef;
double Rhv = Undef;
double Pst = Undef;
double m_energy_offset = 0.0;
double m_entropy_offset = 0.0;
std::string m_name;
std::string m_formula;
@ -219,7 +222,7 @@ private:
double X, double Y,
double atx, double aty, double rtx, double rty);
int kbr;
int kbr = 0;
double Vmin, Vmax;
double Pmin, Pmax;
double dvbf, dv;

View File

@ -243,7 +243,7 @@ private:
vector_fp m_dk;
//! temperature
doublereal m_temp;
double m_temp = -1.0;
//! Multicomponent diffusion coefficients. @see eval_H_matrix()
DenseMatrix m_multidiff;
@ -255,28 +255,28 @@ private:
vector_fp m_spwork2;
//! Pressure Gradient
doublereal m_gradP;
double m_gradP = 0.0;
//! Update-to-date variable for Knudsen diffusion coefficients
bool m_knudsen_ok;
bool m_knudsen_ok = false;
//! Update-to-date variable for Binary diffusion coefficients
bool m_bulk_ok;
bool m_bulk_ok = false;
//! Porosity
doublereal m_porosity;
double m_porosity = 0.0;
//! Tortuosity
doublereal m_tortuosity;
double m_tortuosity = 1.0;
//! Pore radius (meter)
doublereal m_pore_radius;
double m_pore_radius = 0.0;
//! Particle diameter
/*!
* The medium is assumed to consist of particles of size m_diam. units = m
*/
doublereal m_diam;
double m_diam = 0.0;
//! Permeability of the media
/*!
@ -291,7 +291,7 @@ private:
*
* units are m2
*/
doublereal m_perm;
double m_perm = -1.0;
//! Pointer to the transport object for the gas phase
std::unique_ptr<Transport> m_gastran;

View File

@ -296,23 +296,23 @@ protected:
vector_fp m_molefracs;
//! Internal storage for the viscosity of the mixture (kg /m /s)
doublereal m_viscmix;
double m_viscmix = 0.0;
//! Update boolean for mixture rule for the mixture viscosity
bool m_visc_ok;
bool m_visc_ok = false;
//! Update boolean for the weighting factors for the mixture viscosity
bool m_viscwt_ok;
bool m_viscwt_ok = false;
//! Update boolean for the species viscosities
bool m_spvisc_ok;
bool m_spvisc_ok = false;
//! Update boolean for the binary diffusivities at unit pressure
bool m_bindiff_ok;
bool m_bindiff_ok = false;
//! Type of the polynomial fits to temperature. CK_Mode means Chemkin mode.
//! Currently CA_Mode is used which are different types of fits to temperature.
int m_mode;
int m_mode = 0;
//! m_phi is a Viscosity Weighting Function. size = m_nsp * n_nsp
DenseMatrix m_phi;
@ -357,26 +357,26 @@ protected:
//! Current value of the temperature at which the properties in this object
//! are calculated (Kelvin).
doublereal m_temp;
double m_temp = -1.0;
//! Current value of Boltzmann constant times the temperature (Joules)
doublereal m_kbt;
double m_kbt = 0.0;
//! current value of Boltzmann constant times the temperature.
//! (Joules) to 1/2 power
doublereal m_sqrt_kbt;
double m_sqrt_kbt = 0.0;
//! current value of temperature to 1/2 power
doublereal m_sqrt_t;
double m_sqrt_t = 0.0;
//! Current value of the log of the temperature
doublereal m_logt;
double m_logt = 0.0;
//! Current value of temperature to 1/4 power
doublereal m_t14;
double m_t14 = 0.0;
//! Current value of temperature to the 3/2 power
doublereal m_t32;
double m_t32 = 0.0;
//! Polynomial fits to the binary diffusivity of each species
/*!
@ -548,7 +548,7 @@ protected:
vector_fp m_quad_polar;
//! Level of verbose printing during initialization
int m_log_level;
int m_log_level = 0;
};
} // namespace Cantera

View File

@ -49,7 +49,7 @@ namespace Cantera
class IonGasTransport : public MixTransport
{
public:
IonGasTransport();
IonGasTransport() = default;
virtual std::string transportModel() const {
return "Ion";
@ -107,7 +107,7 @@ protected:
std::vector<size_t> m_kNeutral;
//! index of electron
size_t m_kElectron;
size_t m_kElectron = npos;
//! parameter of omega11 of n64
DenseMatrix m_gamma;

View File

@ -57,7 +57,7 @@ class MixTransport : public GasTransport
{
public:
//! Default constructor.
MixTransport();
MixTransport() = default;
virtual std::string transportModel() const {
return (m_mode == CK_Mode) ? "CK_Mix" : "Mix";
@ -171,13 +171,13 @@ protected:
/*!
* Units = W /m /K
*/
doublereal m_lambda;
double m_lambda = 0.0;
//! Update boolean for the species thermal conductivities
bool m_spcond_ok;
bool m_spcond_ok = false;
//! Update boolean for the mixture rule for the mixture thermal conductivity
bool m_condmix_ok;
bool m_condmix_ok = false;
};
}
#endif

View File

@ -781,17 +781,17 @@ protected:
ThermoPhase* m_thermo;
//! true if finalize has been called
bool m_ready;
bool m_ready = false;
//! Number of species
size_t m_nsp;
size_t m_nsp = 0;
//! Number of dimensions used in flux expressions
size_t m_nDim;
//! Velocity basis from which diffusion velocities are computed.
//! Defaults to the mass averaged basis = -2
int m_velocityBasis;
int m_velocityBasis = VB_MASSAVG;
//! reference to Solution
std::weak_ptr<Solution> m_root;

View File

@ -18,8 +18,8 @@ class Species;
class TransportData
{
public:
TransportData() {}
virtual ~TransportData() {}
TransportData() = default;
virtual ~TransportData() = default;
virtual void validate(const Species& species) {}
@ -45,7 +45,7 @@ protected:
class GasTransportData : public TransportData
{
public:
GasTransportData();
GasTransportData() = default;
//! Construct a GasTransportData object using MKS units for all parameters.
GasTransportData(const std::string& geometry, double diameter,
@ -76,30 +76,30 @@ public:
std::string geometry;
//! The Lennard-Jones collision diameter [m]
double diameter;
double diameter = 0.0;
//! The Lennard-Jones well depth [J]
double well_depth;
double well_depth = 0.0;
//! The permanent dipole moment of the molecule [Coulomb-m]. Default 0.0.
double dipole;
double dipole = 0.0;
//! The polarizability of the molecule [m^3]. Default 0.0.
double polarizability;
double polarizability = 0.0;
//! The rotational relaxation number (the number of collisions it takes to
//! equilibrate the rotational degrees of freedom with the temperature).
//! Default 0.0.
double rotational_relaxation;
double rotational_relaxation = 0.0;
//! Pitzer's acentric factor [dimensionless]. Default 0.0.
double acentric_factor;
double acentric_factor = 0.0;
//! dispersion normalized by e^2. [m^5] Default 0.0.
double dispersion_coefficient;
double dispersion_coefficient = 0.0;
//! quadrupole. Default 0.0.
double quadrupole_polarizability;
double quadrupole_polarizability = 0.0;
};
//! Create a new TransportData object from an AnyMap specification

View File

@ -23,9 +23,9 @@ class ReactorBase;
class FlowDevice
{
public:
FlowDevice();
FlowDevice() = default;
virtual ~FlowDevice() {}
virtual ~FlowDevice() = default;
FlowDevice(const FlowDevice&) = delete;
FlowDevice& operator=(const FlowDevice&) = delete;
@ -88,21 +88,22 @@ public:
virtual void setTimeFunction(Func1* g);
protected:
double m_mdot;
double m_mdot = Undef;
//! Function set by setPressureFunction; used by updateMassFlowRate
Func1* m_pfunc;
Func1* m_pfunc = nullptr;
//! Function set by setTimeFunction; used by updateMassFlowRate
Func1* m_tfunc;
Func1* m_tfunc = nullptr;
//! Coefficient set by derived classes; used by updateMassFlowRate
double m_coeff;
double m_coeff = 1.0;
private:
size_t m_nspin, m_nspout;
ReactorBase* m_in;
ReactorBase* m_out;
size_t m_nspin = 0;
size_t m_nspout = 0;
ReactorBase* m_in = nullptr;
ReactorBase* m_out = nullptr;
std::vector<size_t> m_in2out, m_out2in;
};

View File

@ -15,7 +15,7 @@ namespace Cantera
class FlowReactor : public Reactor
{
public:
FlowReactor();
FlowReactor() = default;
virtual std::string type() const {
return "FlowReactor";
@ -47,9 +47,14 @@ public:
virtual size_t componentIndex(const std::string& nm) const;
protected:
doublereal m_speed, m_dist, m_T;
doublereal m_fctr;
doublereal m_rho0, m_speed0, m_P0, m_h0;
double m_speed = 0.0;
double m_dist = 0.0;
double m_T = 0.0;
double m_fctr = 1.0e10;
double m_rho0 = 0.0;
double m_speed0 = 0.0;
double m_P0 = 0.0;
double m_h0 = 0.0;
};
}

View File

@ -43,7 +43,7 @@ class AnyMap;
class Reactor : public ReactorBase
{
public:
Reactor();
Reactor() = default;
virtual std::string type() const {
return "Reactor";
@ -221,13 +221,13 @@ protected:
virtual void getSurfaceInitialConditions(double* y);
//! Pointer to the homogeneous Kinetics object that handles the reactions
Kinetics* m_kin;
Kinetics* m_kin = nullptr;
doublereal m_vdot; //!< net rate of volume change from moving walls [m^3/s]
double m_vdot = 0.0; //!< net rate of volume change from moving walls [m^3/s]
double m_Qdot; //!< net heat transfer into the reactor, through walls [W]
double m_Qdot = 0.0; //!< net heat transfer into the reactor, through walls [W]
doublereal m_mass; //!< total mass
double m_mass = 0.0; //!< total mass
vector_fp m_work;
//! Production rates of gas phase species on surfaces [kmol/s]
@ -235,9 +235,9 @@ protected:
vector_fp m_wdot; //!< Species net molar production rates
vector_fp m_uk; //!< Species molar internal energies
bool m_chem;
bool m_energy;
size_t m_nv;
bool m_chem = false;
bool m_energy = true;
size_t m_nv = 0;
size_t m_nv_surf; //!!< Number of variables associated with reactor surfaces
vector_fp m_advancelimits; //!< Advance step limit

View File

@ -49,7 +49,7 @@ class ReactorBase
{
public:
explicit ReactorBase(const std::string& name = "(none)");
virtual ~ReactorBase() {}
virtual ~ReactorBase() = default;
ReactorBase(const ReactorBase&) = delete;
ReactorBase& operator=(const ReactorBase&) = delete;
@ -249,13 +249,13 @@ public:
protected:
//! Number of homogeneous species in the mixture
size_t m_nsp;
size_t m_nsp = 0;
ThermoPhase* m_thermo;
double m_vol; //!< Current volume of the reactor [m^3]
double m_enthalpy; //!< Current specific enthalpy of the reactor [J/kg]
double m_intEnergy; //!< Current internal energy of the reactor [J/kg]
double m_pressure; //!< Current pressure in the reactor [Pa]
ThermoPhase* m_thermo = nullptr;
double m_vol = 1.0; //!< Current volume of the reactor [m^3]
double m_enthalpy = 0.0; //!< Current specific enthalpy of the reactor [J/kg]
double m_intEnergy = 0.0; //!< Current internal energy of the reactor [J/kg]
double m_pressure = 0.0; //!< Current pressure in the reactor [Pa]
vector_fp m_state;
std::vector<FlowDevice*> m_inlet, m_outlet;
@ -268,7 +268,7 @@ protected:
std::string m_name;
//! The ReactorNet that this reactor is part of
ReactorNet* m_net;
ReactorNet* m_net = nullptr;
};
}

View File

@ -303,23 +303,25 @@ protected:
std::vector<Reactor*> m_reactors;
std::unique_ptr<Integrator> m_integ;
doublereal m_time;
bool m_init;
bool m_integrator_init; //!< True if integrator initialization is current
size_t m_nv;
double m_time = 0.0;
bool m_init = false;
bool m_integrator_init = false; //!< True if integrator initialization is current
size_t m_nv = 0;
//! m_start[n] is the starting point in the state vector for reactor n
std::vector<size_t> m_start;
vector_fp m_atol;
doublereal m_rtol, m_rtolsens;
doublereal m_atols, m_atolsens;
double m_rtol = 1.0e-9;
double m_rtolsens = 1.0e-4;
double m_atols = 1.0e-15;
double m_atolsens = 1.0e-6;
//! Maximum integrator internal timestep. Default of 0.0 means infinity.
doublereal m_maxstep;
double m_maxstep = 0.0;
int m_maxErrTestFails;
bool m_verbose;
int m_maxErrTestFails = 0;
bool m_verbose = false;
//! Names corresponding to each sensitivity parameter
std::vector<std::string> m_paramNames;

View File

@ -20,8 +20,8 @@ class SurfPhase;
class ReactorSurface
{
public:
ReactorSurface();
virtual ~ReactorSurface() {}
ReactorSurface() = default;
virtual ~ReactorSurface() = default;
ReactorSurface(const ReactorSurface&) = delete;
ReactorSurface& operator=(const ReactorSurface&) = delete;
@ -87,11 +87,11 @@ public:
void resetSensitivityParameters();
protected:
double m_area;
double m_area = 1.0;
SurfPhase* m_thermo;
Kinetics* m_kinetics;
ReactorBase* m_reactor;
SurfPhase* m_thermo = nullptr;
Kinetics* m_kinetics = nullptr;
ReactorBase* m_reactor = nullptr;
vector_fp m_cov;
std::vector<SensitivityParameter> m_params;
};

View File

@ -84,12 +84,12 @@ public:
}
protected:
ReactorBase* m_left;
ReactorBase* m_right;
ReactorBase* m_left = nullptr;
ReactorBase* m_right = nullptr;
std::vector<ReactorSurface> m_surf;
double m_area;
double m_area = 1.0;
};
//! Represents a wall between between two ReactorBase objects.
@ -100,7 +100,7 @@ protected:
class Wall : public WallBase
{
public:
Wall();
Wall() = default;
//! String indicating the wall model implemented. Usually
//! corresponds to the name of the derived class.
@ -186,19 +186,19 @@ public:
protected:
//! expansion rate coefficient
double m_k;
double m_k = 0.0;
//! heat transfer coefficient
double m_rrth;
double m_rrth = 0.0;
//! emissivity
double m_emiss;
double m_emiss = 0.0;
//! Velocity function
Func1* m_vf;
Func1* m_vf = nullptr;
//! Heat flux function
Func1* m_qf;
Func1* m_qf = nullptr;
};
}

View File

@ -19,7 +19,7 @@ namespace Cantera
class MassFlowController : public FlowDevice
{
public:
MassFlowController();
MassFlowController() = default;
virtual std::string type() const {
return "MassFlowController";
@ -63,7 +63,7 @@ public:
class PressureController : public FlowDevice
{
public:
PressureController();
PressureController() = default;
virtual std::string type() const {
return "PressureController";
@ -104,7 +104,7 @@ public:
virtual void updateMassFlowRate(double time);
protected:
FlowDevice* m_master;
FlowDevice* m_master = nullptr;
};
//! Supply a mass flow rate that is a function of the pressure drop across the
@ -117,7 +117,7 @@ protected:
class Valve : public FlowDevice
{
public:
Valve();
Valve() = default;
virtual std::string type() const {
return "Valve";

View File

@ -562,11 +562,6 @@ std::unordered_map<std::string, std::vector<std::string>> AnyMap::s_tailFields;
// Methods of class AnyBase
AnyBase::AnyBase()
: m_line(-1)
, m_column(0)
{}
void AnyBase::setLoc(int line, int column)
{
m_line = line;

Some files were not shown because too many files have changed in this diff Show More