[Doc] Capitalize proper nouns and acronyms
This commit is contained in:
parent
51c8d7365a
commit
341b137766
127 changed files with 466 additions and 467 deletions
|
|
@ -1384,8 +1384,7 @@ if env['use_sundials'] == 'y':
|
|||
else:
|
||||
env['sundials_libs'] = []
|
||||
|
||||
# Add lapack and blas to the link line
|
||||
# If there is a special blas and lapack add that in
|
||||
# Add LAPACK and BLAS to the link line
|
||||
if env['blas_lapack_libs']:
|
||||
linkLibs.extend(env['blas_lapack_libs'])
|
||||
linkSharedLibs.extend(env['blas_lapack_libs'])
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ namespace Cantera
|
|||
//! Enum containing Cantera's behavior for situations where overflow or underflow of real variables
|
||||
//! may occur.
|
||||
/*!
|
||||
* Note this frequently occurs when taking exponentials of delta gibbs energies of reactions
|
||||
* Note this frequently occurs when taking exponentials of delta Gibbs energies of reactions
|
||||
* or when taking the exponentials of logs of activity coefficients.
|
||||
*/
|
||||
enum CT_RealNumber_Range_Behavior {
|
||||
|
|
|
|||
|
|
@ -727,7 +727,7 @@ void getNamedStringValue(const Cantera::XML_Node& node, const std::string& nameS
|
|||
std::string& typeString);
|
||||
|
||||
//! This function reads a child node with the name, nameString, and returns
|
||||
//! its xml value as the return string
|
||||
//! its XML value as the return string
|
||||
/*!
|
||||
* If the child XML_node named "name" doesn't exist, the empty string is returned.
|
||||
*
|
||||
|
|
@ -783,7 +783,7 @@ void ct2ctml(const char* file, const int debug = 0);
|
|||
//! Get a string with the ctml representation of a cti file.
|
||||
/*!
|
||||
* @param file Path to the input file in CTI format
|
||||
* @return String containing the xml representation of the input file
|
||||
* @return String containing the XML representation of the input file
|
||||
*
|
||||
* @ingroup inputfiles
|
||||
*/
|
||||
|
|
@ -792,7 +792,7 @@ std::string ct2ctml_string(const std::string& file);
|
|||
//! Get a string with the ctml representation of a cti input string.
|
||||
/*!
|
||||
* @param cti String containing the cti representation
|
||||
* @return String containing the xml representation of the input
|
||||
* @return String containing the XML representation of the input
|
||||
*
|
||||
* @ingroup inputfiles
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ void popError();
|
|||
* Additional directories may be added by calling function addDirectory.
|
||||
*
|
||||
* There are two different types of input files within %Cantera:
|
||||
* - ctml: This is an xml file laid out in such a way that %Cantera can
|
||||
* - ctml: This is an XML file laid out in such a way that %Cantera can
|
||||
* interpret the contents. This is the essential input file within
|
||||
* Cantera, and contains all elements that are involved with simulation,
|
||||
* error propagation, data support, and versioning.
|
||||
|
|
@ -224,15 +224,15 @@ void close_XML_File(const std::string& file);
|
|||
*
|
||||
* @param file_ID This is a concatenation of two strings separated
|
||||
* by the "#" character. The string before the
|
||||
* pound character is the file name of an xml
|
||||
* pound character is the file name of an XML
|
||||
* file to carry out the search. The string after
|
||||
* the # character is the ID attribute
|
||||
* of the xml element to search for.
|
||||
* of the XML element to search for.
|
||||
* The string is interpreted as a file string if
|
||||
* no # character is in the string.
|
||||
*
|
||||
* @param root If the file string is empty, searches for the
|
||||
* xml element with matching ID attribute are
|
||||
* XML element with matching ID attribute are
|
||||
* carried out from this XML node.
|
||||
*
|
||||
* @return
|
||||
|
|
@ -249,21 +249,21 @@ XML_Node* get_XML_Node(const std::string& file_ID, XML_Node* root);
|
|||
* XML element name and the ID attribute of the XML element.
|
||||
* An exact match of both is usually required. However, the
|
||||
* ID attribute may be set to "", in which case the first
|
||||
* xml element with the correct element name will be returned.
|
||||
* XML element with the correct element name will be returned.
|
||||
*
|
||||
* @param nameTarget This is the XML element name to look for.
|
||||
*
|
||||
* @param file_ID This is a concatenation of two strings separated
|
||||
* by the "#" character. The string before the
|
||||
* pound character is the file name of an xml
|
||||
* pound character is the file name of an XML
|
||||
* file to carry out the search. The string after
|
||||
* the # character is the ID attribute
|
||||
* of the xml element to search for.
|
||||
* of the XML element to search for.
|
||||
* The string is interpreted as a file string if
|
||||
* no # character is in the string.
|
||||
*
|
||||
* @param root If the file string is empty, searches for the
|
||||
* xml element with matching ID attribute are
|
||||
* XML element with matching ID attribute are
|
||||
* carried out from this XML node.
|
||||
*
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ public:
|
|||
*/
|
||||
XML_Node& addChild(const std::string& sname);
|
||||
|
||||
//! Add a child node to the current xml node, and at the
|
||||
//! Add a child node to the current XML node, and at the
|
||||
//! same time add a value to the child
|
||||
/*!
|
||||
* Resulting XML string:
|
||||
|
|
@ -169,7 +169,7 @@ public:
|
|||
*/
|
||||
XML_Node& addChild(const std::string& name, const std::string& value);
|
||||
|
||||
//! Add a child node to the current xml node, and at the
|
||||
//! Add a child node to the current XML node, and at the
|
||||
//! same time add a formatted value to the child
|
||||
/*!
|
||||
* This version supplies a formatting string (printf format)
|
||||
|
|
@ -419,7 +419,7 @@ public:
|
|||
//! Return an unchangeable reference to the vector of children of the current node
|
||||
/*!
|
||||
* Each of the individual XML_Node child pointers, however,
|
||||
* is to a changeable xml node object.
|
||||
* is to a changeable XML node object.
|
||||
*
|
||||
*/
|
||||
const std::vector<XML_Node*>& children() const;
|
||||
|
|
@ -434,7 +434,7 @@ public:
|
|||
//! Boolean function indicating whether a comment
|
||||
bool isComment() const;
|
||||
|
||||
//! Require that the current xml node have an attribute named by the first
|
||||
//! Require that the current XML node have an attribute named by the first
|
||||
//! argument, a, and that this attribute have the the string value listed
|
||||
//! in the second argument, v.
|
||||
/*!
|
||||
|
|
@ -446,13 +446,13 @@ public:
|
|||
void _require(const std::string& a, const std::string& v) const;
|
||||
|
||||
//! This routine carries out a recursive search for an XML node based
|
||||
//! on both the xml element name and the attribute ID.
|
||||
//! on both the XML element name and the attribute ID.
|
||||
/*!
|
||||
* If exact matches are found for both fields, the pointer
|
||||
* to the matching XML Node is returned.
|
||||
*
|
||||
* The ID attribute may be defaulted by setting it to "". In this case the
|
||||
* pointer to the first xml element matching the name only is returned.
|
||||
* pointer to the first XML element matching the name only is returned.
|
||||
*
|
||||
* @param nameTarget Name of the XML Node that is being searched for
|
||||
* @param idTarget "id" attribute of the XML Node that the routine
|
||||
|
|
@ -468,14 +468,14 @@ public:
|
|||
const std::string& idTarget) const;
|
||||
|
||||
//! This routine carries out a search for an XML node based
|
||||
//! on both the xml element name and the attribute ID and an integer index.
|
||||
//! on both the XML element name and the attribute ID and an integer index.
|
||||
/*!
|
||||
* If exact matches are found for all fields, the pointer
|
||||
* to the matching XML Node is returned. The search is only carried out on
|
||||
* the current element and the child elements of the current element.
|
||||
*
|
||||
* The "id" attribute may be defaulted by setting it to "".
|
||||
* In this case the pointer to the first xml element matching the name
|
||||
* In this case the pointer to the first XML element matching the name
|
||||
* only is returned.
|
||||
*
|
||||
* @param nameTarget Name of the XML Node that is being searched for
|
||||
|
|
@ -490,13 +490,13 @@ public:
|
|||
const std::string& idTarget, const int index) const;
|
||||
|
||||
//! This routine carries out a recursive search for an XML node based
|
||||
//! on the xml element attribute, "id"
|
||||
//! on the XML element attribute, "id"
|
||||
/*!
|
||||
* If exact match is found, the pointer
|
||||
* to the matching XML Node is returned. If not, 0 is returned.
|
||||
*
|
||||
* The ID attribute may be defaulted by setting it to "".
|
||||
* In this case the pointer to the first xml element matching the name
|
||||
* In this case the pointer to the first XML element matching the name
|
||||
* only is returned.
|
||||
*
|
||||
* @param id "id" attribute of the XML Node that the routine
|
||||
|
|
@ -588,7 +588,7 @@ public:
|
|||
*/
|
||||
XML_Node& child(const std::string& loc) const;
|
||||
|
||||
//! Write the header to the xml file to the specified ostream
|
||||
//! Write the header to the XML file to the specified ostream
|
||||
/*!
|
||||
* @param s ostream to write the output to
|
||||
*/
|
||||
|
|
@ -664,7 +664,7 @@ private:
|
|||
/*!
|
||||
* This is the main recursive routine. It doesn't put a final endl
|
||||
* on. This is fixed up in the public method. A method to only write out a limited
|
||||
* amount of the xml tree has been added.
|
||||
* amount of the XML tree has been added.
|
||||
*
|
||||
* @param s ostream to write to
|
||||
* @param level Indentation level to work from
|
||||
|
|
@ -685,10 +685,10 @@ protected:
|
|||
*/
|
||||
std::string m_name;
|
||||
|
||||
//! Value of the xml node
|
||||
//! Value of the XML node
|
||||
/*!
|
||||
* This is the string contents of the XML node. For
|
||||
* example. The xml node named eps:
|
||||
* example. The XML node named eps:
|
||||
*
|
||||
* <eps>
|
||||
* valueString
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ public:
|
|||
* @param loglevel Specify amount of debug logging (0 to disable)
|
||||
* @return Successful returns are indicated by a return value of 0.
|
||||
* Unsuccessful returns are indicated by a return value of -1 for lack
|
||||
* of convergence or -3 for a singular jacobian.
|
||||
* of convergence or -3 for a singular Jacobian.
|
||||
*/
|
||||
int equilibrate(thermo_t& s, const char* XY, vector_fp& elMoles,
|
||||
bool useThermoPhaseElementPotentials = false, int loglevel = 0);
|
||||
|
|
@ -195,7 +195,7 @@ protected:
|
|||
*
|
||||
* We have found that the previous estimate may not be good enough to
|
||||
* avoid drastic numerical issues associated with the use of a numerically
|
||||
* generated jacobian used in the main algorithm.
|
||||
* generated Jacobian used in the main algorithm.
|
||||
*
|
||||
* The Brinkley algorithm, here, assumes a constant T, P system and uses a
|
||||
* linearized analytical Jacobian that turns out to be very stable even
|
||||
|
|
@ -211,14 +211,14 @@ protected:
|
|||
*
|
||||
* Nonideal phases are handled in principle. This is done by calculating
|
||||
* the activity coefficients and adding them into the formula in the
|
||||
* correct position. However, these are treated as a rhs contribution
|
||||
* correct position. However, these are treated as a RHS contribution
|
||||
* only. Therefore, convergence might be a problem. This has not been
|
||||
* tested. Also molality based unit systems aren't handled.
|
||||
*
|
||||
* On return, int return value contains the success code:
|
||||
* - 0 - successful
|
||||
* - 1 - unsuccessful, max num iterations exceeded
|
||||
* - -3 - unsuccessful, singular jacobian
|
||||
* - -3 - unsuccessful, singular Jacobian
|
||||
*
|
||||
* NOTE: update for activity coefficients.
|
||||
*/
|
||||
|
|
@ -325,7 +325,7 @@ protected:
|
|||
vector_fp m_mu_RT;
|
||||
|
||||
/**
|
||||
* Dimensionless values of the gibbs free energy for the
|
||||
* Dimensionless values of the Gibbs free energy for the
|
||||
* standard state of each species, at the temperature and
|
||||
* pressure of the solution (the star standard state).
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ namespace VCSnonideal
|
|||
* @param mphase MultiPhase object that is the source for all of the information
|
||||
* @param vprob VCS_PROB problem definition that gets all of the information
|
||||
*
|
||||
* Note, both objects share the underlying Thermophase objects. So, neither
|
||||
* Note, both objects share the underlying ThermoPhase objects. So, neither
|
||||
* can be const objects.
|
||||
*/
|
||||
int vcs_Cantera_to_vprob(Cantera::MultiPhase* mphase,
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ public:
|
|||
* The results are held internally within the object.
|
||||
*
|
||||
* @param kspec Species number (within the phase)
|
||||
* @return Gstar[kspec] returns the gibbs free energy for the
|
||||
* @return Gstar[kspec] returns the Gibbs free energy for the
|
||||
* standard state of the kth species.
|
||||
*/
|
||||
double GStar_calc_one(size_t kspec) const;
|
||||
|
|
@ -220,7 +220,7 @@ public:
|
|||
//! of a species, return a value for one species
|
||||
/*!
|
||||
* @param kspec species index
|
||||
* @return return value of the gibbs free energy
|
||||
* @return return value of the Gibbs free energy
|
||||
*/
|
||||
double G0_calc_one(size_t kspec) const;
|
||||
|
||||
|
|
@ -274,12 +274,12 @@ public:
|
|||
*/
|
||||
void setState_T(const double temperature_Kelvin);
|
||||
|
||||
// Downloads the ln ActCoeff jacobian into the VCS version of the
|
||||
// ln ActCoeff jacobian.
|
||||
// Downloads the ln ActCoeff Jacobian into the VCS version of the
|
||||
// ln ActCoeff Jacobian.
|
||||
/*
|
||||
* This is essentially a scatter operation.
|
||||
*
|
||||
* @param LnAcJac_VCS jacobian parameter
|
||||
* @param LnAcJac_VCS Jacobian parameter
|
||||
* The Jacobians are actually d( lnActCoeff) / d (MolNumber);
|
||||
* dLnActCoeffdMolNumber(k,j)
|
||||
*
|
||||
|
|
@ -486,7 +486,7 @@ public:
|
|||
* Also decide whether we need a new charge neutrality element in the
|
||||
* phase to enforce a charge neutrality constraint.
|
||||
*
|
||||
* @param tPhase Pointer to the thermophase object
|
||||
* @param tPhase Pointer to the ThermoPhase object
|
||||
*/
|
||||
size_t transferElementsFM(const Cantera::ThermoPhase* const tPhase);
|
||||
|
||||
|
|
|
|||
|
|
@ -666,7 +666,7 @@ public:
|
|||
* The actual problem statement is assumed to be in the structure
|
||||
* already. This is a wrapper around the solve_TP() function. In this
|
||||
* wrapper, we nondimensionalize the system we calculate the standard
|
||||
* state gibbs free energies of the species, and we decide whether to we
|
||||
* state Gibbs free energies of the species, and we decide whether to we
|
||||
* need to use the initial guess algorithm.
|
||||
*
|
||||
* @param ipr = 1 -> Print results to standard output;
|
||||
|
|
@ -1305,7 +1305,7 @@ private:
|
|||
double vcs_minor_alt_calc(size_t kspec, size_t irxn, bool* do_delete,
|
||||
char* ANOTE=0) const;
|
||||
|
||||
//! This routine optimizes the minimization of the total gibbs free energy
|
||||
//! This routine optimizes the minimization of the total Gibbs free energy
|
||||
//! by making sure the slope of the following functional stays negative:
|
||||
/*!
|
||||
* The slope of the following functional is equivalent to the slope
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public:
|
|||
* @param thermo The optional parameter may be used to initialize
|
||||
* the object with one ThermoPhase object.
|
||||
* HKM Note -> Since the interface kinetics
|
||||
* object will probably require multiple thermophase
|
||||
* object will probably require multiple ThermoPhase
|
||||
* objects, this is probably not a good idea
|
||||
* to have this parameter.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ protected:
|
|||
size_t m_numTotalSpecies;
|
||||
|
||||
std::vector<vector_int> pLocVec;
|
||||
//! Pointer to the cvode integrator
|
||||
//! Pointer to the CVODE integrator
|
||||
Integrator* m_integ;
|
||||
doublereal m_atol, m_rtol; // tolerances
|
||||
doublereal m_maxstep; //!< max step size
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public:
|
|||
* @param thermo The optional parameter may be used to initialize
|
||||
* the object with one ThermoPhase object.
|
||||
* HKM Note -> Since the interface kinetics
|
||||
* object will probably require multiple thermophase
|
||||
* object will probably require multiple ThermoPhase
|
||||
* objects, this is probably not a good idea
|
||||
* to have this parameter.
|
||||
*/
|
||||
|
|
@ -135,7 +135,7 @@ public:
|
|||
*/
|
||||
void updateExchangeCurrentQuantities();
|
||||
|
||||
//! Return the vector of values for the reaction gibbs free energy change.
|
||||
//! Return the vector of values for the reaction Gibbs free energy change.
|
||||
/*!
|
||||
* (virtual from Kinetics.h)
|
||||
* These values depend upon the concentration of the solution.
|
||||
|
|
@ -330,7 +330,7 @@ public:
|
|||
* kmoles/m2/s.
|
||||
*
|
||||
* For a reaction rate constant that was given in units of kmol/m2/sec when the
|
||||
* reaction type is a butler-volmer form, convert it to exchange current density
|
||||
* reaction type is a Butler-Volmer form, convert it to exchange current density
|
||||
* form (amps/m2).
|
||||
*
|
||||
* @param kfwd Vector of forward reaction rate constants, given in either
|
||||
|
|
@ -553,7 +553,7 @@ protected:
|
|||
*/
|
||||
std::vector<size_t> m_ctrxn;
|
||||
|
||||
//! Vector of Reactions which follow the butler volmer methodology for specifying the
|
||||
//! Vector of Reactions which follow the Butler-Volmer methodology for specifying the
|
||||
//! exchange current density first. Then, the other forms are specified based on this form.
|
||||
/*!
|
||||
* Length is equal to the number of reactions with charge transfer coefficients, m_ctrxn[]
|
||||
|
|
@ -605,14 +605,14 @@ protected:
|
|||
*/
|
||||
vector_fp m_StandardConc;
|
||||
|
||||
//! Vector of delta G^0, the standard state gibbs free energies for each reaction
|
||||
//! Vector of delta G^0, the standard state Gibbs free energies for each reaction
|
||||
/*!
|
||||
* Length is the number of reactions
|
||||
* units are Joule kmol-1
|
||||
*/
|
||||
vector_fp m_deltaG0;
|
||||
|
||||
//! Vector of deltaG[] of reaction, the delta gibbs free energies for each reaction
|
||||
//! Vector of deltaG[] of reaction, the delta Gibbs free energies for each reaction
|
||||
/*!
|
||||
* Length is the number of reactions
|
||||
* units are Joule kmol-1
|
||||
|
|
@ -661,7 +661,7 @@ protected:
|
|||
//! Boolean flag indicating whether any reaction in the mechanism
|
||||
//! is described by an exchange current density expression
|
||||
/*!
|
||||
* If this is true, the standard state gibbs free energy of the reaction
|
||||
* If this is true, the standard state Gibbs free energy of the reaction
|
||||
* and the product of the reactant standard concentrations must be
|
||||
* precalculated in order to calculate the rate constant.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -474,7 +474,7 @@ public:
|
|||
*/
|
||||
virtual void getRevReactionDelta(const doublereal* g, doublereal* dg);
|
||||
|
||||
//! Return the vector of values for the reaction gibbs free energy change.
|
||||
//! Return the vector of values for the reaction Gibbs free energy change.
|
||||
/*!
|
||||
* (virtual from Kinetics.h)
|
||||
* These values depend upon the concentration of the solution.
|
||||
|
|
@ -527,7 +527,7 @@ public:
|
|||
|
||||
/**
|
||||
* Return the vector of values for the reaction standard state
|
||||
* gibbs free energy change. These values don't depend upon
|
||||
* Gibbs free energy change. These values don't depend upon
|
||||
* the concentration of the solution.
|
||||
*
|
||||
* units = J kmol-1
|
||||
|
|
@ -1063,7 +1063,7 @@ protected:
|
|||
std::vector<size_t> m_start;
|
||||
|
||||
/**
|
||||
* Mapping of the phase id, i.e., the id attribute in the xml
|
||||
* Mapping of the phase id, i.e., the id attribute in the XML
|
||||
* phase element to the position of the phase within the
|
||||
* kinetics object. Positions start with the value of 1. The
|
||||
* member function, phaseIndex() decrements by one before
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ public:
|
|||
* progress of the reactions and for calculating the source terms for
|
||||
* species.
|
||||
*
|
||||
* @param phase An XML_Node that contains the xml data describing the
|
||||
* phase. Of particular note to this routine is the child xml
|
||||
* @param phase An XML_Node that contains the XML data describing the
|
||||
* phase. Of particular note to this routine is the child XML
|
||||
* element called "kinetics". The element has one attribute
|
||||
* called "model", with a string value. The value of this
|
||||
* string is used to decide which kinetics manager is used to
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ namespace Cantera
|
|||
*
|
||||
* The functions incrementReaction() and decrementReaction() are used to find
|
||||
* the standard state equilibrium constant for a reaction. Here, output[] is a
|
||||
* vector of length number of reactions, usually the standard gibbs free
|
||||
* energies of reaction, while input, usually the standard state gibbs free
|
||||
* vector of length number of reactions, usually the standard Gibbs free
|
||||
* energies of reaction, while input, usually the standard state Gibbs free
|
||||
* energies of species, is a vector of length number of species.
|
||||
*
|
||||
* Note the stoichiometric coefficient for a species in a reaction is handled
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ void checkRxnElementBalance(Kinetics& kin,
|
|||
* the spnum, stoich, and order vectors. The length of the vectors is the
|
||||
* number of different types of reactants or products found for the reaction.
|
||||
*
|
||||
* @param[in] rxn xml node pointing to the reaction element in the xml tree.
|
||||
* @param[in] rxn XML node pointing to the reaction element in the XML tree.
|
||||
* @param[in] kin Reference to the kinetics object to install the information
|
||||
* into.
|
||||
* @param[in] rp 1 -> Go get the reactants for a reaction; -1 -> Go get the
|
||||
|
|
@ -94,7 +94,7 @@ bool getReagents(const XML_Node& rxn, Kinetics& kin, int rp, std::string default
|
|||
|
||||
//! Read the rate coefficient data from the XML file.
|
||||
/*!
|
||||
* Extract the rate coefficient for a reaction from the xml node, kf.
|
||||
* Extract the rate coefficient for a reaction from the XML node, kf.
|
||||
* kf should point to a XML element named "rateCoeff".
|
||||
* rdata is the partially filled ReactionData object for the reaction.
|
||||
* This function will fill in more fields in the ReactionData object.
|
||||
|
|
@ -116,9 +116,9 @@ void getRateCoefficient(const XML_Node& kf, Kinetics& kin, ReactionData& rdata,
|
|||
|
||||
//! Install information about reactions into the kinetics object, kin.
|
||||
/*!
|
||||
* At this point, parent usually refers to the phase xml element.
|
||||
* At this point, parent usually refers to the phase XML element.
|
||||
* One of the children of this element is reactionArray,
|
||||
* the element which determines where in the xml file to
|
||||
* the element which determines where in the XML file to
|
||||
* look up the reaction rate data.
|
||||
*
|
||||
* @param p parent XML phase element
|
||||
|
|
@ -148,7 +148,7 @@ bool installReactionArrays(const XML_Node& p, Kinetics& kin,
|
|||
* argument. The vector of ThermoPhase objects should consist of pointers to
|
||||
* phases I, A, and B.
|
||||
*
|
||||
* @param phase This is an xml node containing a description of the owning
|
||||
* @param phase This is an XML node containing a description of the owning
|
||||
* phase for the kinetics object. Within the phase is a XML
|
||||
* element called reactionArray containing the location of the
|
||||
* description of the reactions that make up the kinetics object.
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ const int SFLUX_INITIALIZE = 1;
|
|||
const int SFLUX_RESIDUAL = 2;
|
||||
|
||||
//! Calculation of the surface problem is due to the need for a numerical
|
||||
//! jacobian for the gas-problem. The solution is expected to be very close to
|
||||
//! Jacobian for the gas-problem. The solution is expected to be very close to
|
||||
//! the initial guess, and accuracy is needed because solution variables have
|
||||
//! been perturbed from nominal values to create Jacobian entries.
|
||||
const int SFLUX_JACOBIAN = 3;
|
||||
|
|
@ -303,7 +303,7 @@ private:
|
|||
* @param resid output Vector of residuals, length = m_neq
|
||||
* @param CSolnSP Vector of species concentrations, unknowns in the
|
||||
* problem, length = m_neq. These are tweaked in order
|
||||
* to derive the columns of the jacobian.
|
||||
* to derive the columns of the Jacobian.
|
||||
* @param CSolnSPOld Old Vector of species concentrations, unknowns in the
|
||||
* problem, length = m_neq
|
||||
* @param do_time Calculate a time dependent residual
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class BEulerInt : public Integrator
|
|||
{
|
||||
public:
|
||||
/*!
|
||||
* Constructor. Default settings: dense jacobian, no user-supplied
|
||||
* Constructor. Default settings: dense Jacobian, no user-supplied
|
||||
* Jacobian function, Newton iteration.
|
||||
*/
|
||||
BEulerInt();
|
||||
|
|
@ -118,7 +118,7 @@ public:
|
|||
* @param printSolnFirstSteps The solution is printed out the first
|
||||
* "printSolnFirstSteps" steps. After these steps the
|
||||
* other parameters determine the printing. default = 0
|
||||
* @param dumpJacobians Dump jacobians to disk.
|
||||
* @param dumpJacobians Dump Jacobians to disk.
|
||||
*/
|
||||
virtual void setPrintSolnOptions(int printSolnStepInterval,
|
||||
int printSolnNumberToTout,
|
||||
|
|
@ -155,7 +155,7 @@ public:
|
|||
* residual at the current time step.
|
||||
* @param J = Jacobian matrix to be filled in
|
||||
* @param f = Right hand side. This routine returns the current
|
||||
* value of the rhs (output), so that it does
|
||||
* value of the RHS (output), so that it does
|
||||
* not have to be computed again.
|
||||
*/
|
||||
void beuler_jac(GeneralMatrix& J, double* const f,
|
||||
|
|
@ -307,7 +307,7 @@ protected:
|
|||
* @param CJ Inverse of the time step
|
||||
* @param time_curr Current value of the time
|
||||
* @param jac Jacobian
|
||||
* @param num_newt_its number of newton iterations
|
||||
* @param num_newt_its number of Newton iterations
|
||||
* @param num_linear_solves number of linear solves
|
||||
* @param num_backtracks number of backtracs
|
||||
* @param loglevel Log level
|
||||
|
|
@ -351,8 +351,8 @@ protected:
|
|||
* couldn't possibly be representative if the
|
||||
* variable is changed by a lot. (true for
|
||||
* nonlinear systems, false for linear systems)
|
||||
* Maximum increase in variable in any one newton iteration: factor of 2
|
||||
* Maximum decrease in variable in any one newton iteration: factor of 5
|
||||
* Maximum increase in variable in any one Newton iteration: factor of 2
|
||||
* Maximum decrease in variable in any one Newton iteration: factor of 5
|
||||
*
|
||||
* @param y Current value of the solution
|
||||
* @param step0 Current raw step change in y[]
|
||||
|
|
@ -416,7 +416,7 @@ protected:
|
|||
bool m_colScaling;
|
||||
/**
|
||||
* m_matrixConditioning is a boolean. If true, then the
|
||||
* Jacobian and every rhs is multiplied by the inverse
|
||||
* Jacobian and every RHS is multiplied by the inverse
|
||||
* of a matrix that is suppose to reduce the condition
|
||||
* number of the matrix. This is done before row scaling.
|
||||
*/
|
||||
|
|
@ -532,7 +532,7 @@ protected:
|
|||
vector_fp m_rowScales;
|
||||
vector_fp m_colScales;
|
||||
|
||||
//! Pointer to the jacobian representing the time dependent problem
|
||||
//! Pointer to the Jacobian representing the time dependent problem
|
||||
GeneralMatrix* tdjac_ptr;
|
||||
|
||||
/**
|
||||
|
|
@ -558,7 +558,7 @@ protected:
|
|||
*/
|
||||
int m_nJacEval;
|
||||
|
||||
//! Number of total newton iterations
|
||||
//! Number of total Newton iterations
|
||||
int m_numTotalNewtIts;
|
||||
|
||||
//! Total number of linear iterations
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ public:
|
|||
|
||||
//! Solve the matrix problem Ax = b
|
||||
/*!
|
||||
* @param b INPUT rhs of the problem
|
||||
* @param b INPUT RHS of the problem
|
||||
* @param x OUTPUT solution to the problem
|
||||
*
|
||||
* @return Return a success flag
|
||||
|
|
@ -181,7 +181,7 @@ public:
|
|||
|
||||
//! Solve the matrix problem Ax = b
|
||||
/*!
|
||||
* @param b INPUT rhs of the problem
|
||||
* @param b INPUT RHS of the problem
|
||||
* OUTPUT solution to the problem
|
||||
* @param nrhs Number of right hand sides to solve
|
||||
* @param ldb Leading dimension of `b`. Default is nColumns()
|
||||
|
|
@ -278,7 +278,7 @@ public:
|
|||
*/
|
||||
virtual void copyData(const GeneralMatrix& y);
|
||||
|
||||
//! Check to see if we have any zero rows in the jacobian
|
||||
//! Check to see if we have any zero rows in the Jacobian
|
||||
/*!
|
||||
* This utility routine checks to see if any rows are zero.
|
||||
* The smallest row is returned along with the largest coefficient in that row
|
||||
|
|
@ -289,7 +289,7 @@ public:
|
|||
*/
|
||||
virtual size_t checkRows(doublereal& valueSmall) const;
|
||||
|
||||
//! Check to see if we have any zero columns in the jacobian
|
||||
//! Check to see if we have any zero columns in the Jacobian
|
||||
/*!
|
||||
* This utility routine checks to see if any columns are zero.
|
||||
* The smallest column is returned along with the largest coefficient in that column
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class CVodesIntegrator : public Integrator
|
|||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor. Default settings: dense jacobian, no user-supplied
|
||||
* Constructor. Default settings: dense Jacobian, no user-supplied
|
||||
* Jacobian function, Newton iteration.
|
||||
*/
|
||||
CVodesIntegrator();
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public:
|
|||
|
||||
//! Return a const vector of const pointers to the columns
|
||||
/*!
|
||||
* Note, the jacobian can not be altered by this routine, and
|
||||
* Note, the Jacobian can not be altered by this routine, and
|
||||
* therefore the member function is const.
|
||||
*
|
||||
* @return returns a vector of pointers to the top of the columns
|
||||
|
|
@ -196,7 +196,7 @@ public:
|
|||
* The system is then solved using the LAPACK routine dgetrs
|
||||
*
|
||||
* @param A Dense matrix to be factored
|
||||
* @param b rhs(s) to be solved.
|
||||
* @param b RHS(s) to be solved.
|
||||
* @param nrhs Number of right hand sides to solve
|
||||
* @param ldb Leading dimension of b, if nrhs > 1
|
||||
*/
|
||||
|
|
@ -205,7 +205,7 @@ int solve(DenseMatrix& A, double* b, size_t nrhs=1, size_t ldb=0);
|
|||
//! Solve Ax = b for multiple right-hand-side vectors.
|
||||
/*!
|
||||
* @param A Dense matrix to be factored
|
||||
* @param b Dense matrix of rhs's. Each column is a rhs
|
||||
* @param b Dense matrix of RHS's. Each column is a RHS
|
||||
*/
|
||||
int solve(DenseMatrix& A, DenseMatrix& b);
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public:
|
|||
/*!
|
||||
* we set m_factored to 2 to indicate the matrix is now QR factored
|
||||
*
|
||||
* @return Returns the info variable from lapack
|
||||
* @return Returns the info variable from LAPACK
|
||||
*/
|
||||
virtual int factorQR() {
|
||||
throw NotImplementedError("GeneralMatrix::factorQR");
|
||||
|
|
@ -136,7 +136,7 @@ public:
|
|||
|
||||
//! Solves the Ax = b system returning x in the b spot.
|
||||
/*!
|
||||
* @param b Vector for the rhs of the equation system
|
||||
* @param b Vector for the RHS of the equation system
|
||||
* @param nrhs Number of right-hand sides to solve, default 1
|
||||
* @param ldb Leading dimension of the right-hand side array.
|
||||
* Defaults to nRows()
|
||||
|
|
@ -204,7 +204,7 @@ public:
|
|||
*/
|
||||
virtual doublereal* const* colPts() = 0;
|
||||
|
||||
//! Check to see if we have any zero rows in the jacobian
|
||||
//! Check to see if we have any zero rows in the Jacobian
|
||||
/*!
|
||||
* This utility routine checks to see if any rows are zero.
|
||||
* The smallest row is returned along with the largest coefficient in that row
|
||||
|
|
@ -215,7 +215,7 @@ public:
|
|||
*/
|
||||
virtual size_t checkRows(doublereal& valueSmall) const = 0;
|
||||
|
||||
//! Check to see if we have any zero columns in the jacobian
|
||||
//! Check to see if we have any zero columns in the Jacobian
|
||||
/*!
|
||||
* This utility routine checks to see if any columns are zero.
|
||||
* The smallest column is returned along with the largest coefficient in that column
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "sundials/sundials_nvector.h"
|
||||
|
||||
// These constants are defined internally in the ida package, ida.c
|
||||
// These constants are defined internally in the IDA package, ida.c
|
||||
#define IDA_NN 0
|
||||
#define IDA_SS 1
|
||||
#define IDA_SV 2
|
||||
|
|
@ -43,7 +43,7 @@ public:
|
|||
|
||||
//! Constructor.
|
||||
/*!
|
||||
* Default settings: dense jacobian, no user-supplied Jacobian function, Newton iteration.
|
||||
* Default settings: dense Jacobian, no user-supplied Jacobian function, Newton iteration.
|
||||
*
|
||||
* @param f Function that will supply the time dependent residual to be solved
|
||||
*/
|
||||
|
|
@ -95,13 +95,13 @@ public:
|
|||
virtual double getCurrentStepFromIDA();
|
||||
|
||||
|
||||
//! Set the form of the jacobian
|
||||
//! Set the form of the Jacobian
|
||||
/*!
|
||||
*
|
||||
* @param formJac Form of the jacobian
|
||||
* @param formJac Form of the Jacobian
|
||||
*
|
||||
* 0 numerical jacobian
|
||||
* 1 analytical jacobian given by the evalJacobianDP() function
|
||||
* 0 numerical Jacobian
|
||||
* 1 analytical Jacobian given by the evalJacobianDP() function
|
||||
*/
|
||||
virtual void setJacobianType(int formJac);
|
||||
|
||||
|
|
@ -261,12 +261,12 @@ protected:
|
|||
//! maximum time step order of the method
|
||||
int m_maxord;
|
||||
|
||||
//! Form of the jacobian
|
||||
//! Form of the Jacobian
|
||||
/*!
|
||||
* 0 numerical jacobian created by ida
|
||||
* 1 analytical jacobian. Must have populated the evalJacobianDP()
|
||||
* 0 numerical Jacobian created by IDA
|
||||
* 1 analytical Jacobian. Must have populated the evalJacobianDP()
|
||||
* function in the ResidJacEval class.
|
||||
* 2 numerical jacobian formed by the ResidJacEval class (unimplemented)
|
||||
* 2 numerical Jacobian formed by the ResidJacEval class (unimplemented)
|
||||
*/
|
||||
int m_formJac;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ namespace Cantera
|
|||
#define NSOLN_RETN_FAIL_STEPTOOSMALL -1
|
||||
//! The nonlinear problem didn't solve the problem
|
||||
#define NSOLN_RETN_FAIL_DAMPSTEP -2
|
||||
//! The nonlinear problem's jacobian is singular
|
||||
//! The nonlinear problem's Jacobian is singular
|
||||
#define NSOLN_RETN_MATRIXINVERSIONERROR -3
|
||||
//! The nonlinear problem's jacobian formation produced an error
|
||||
//! The nonlinear problem's Jacobian formation produced an error
|
||||
#define NSOLN_RETN_JACOBIANFORMATIONERROR -4
|
||||
//! The nonlinear problem's base residual produced an error
|
||||
#define NSOLN_RETN_RESIDUALFORMATIONERROR -5
|
||||
|
|
@ -66,9 +66,9 @@ namespace Cantera
|
|||
|
||||
//@{
|
||||
/// @name Constant which determines the type of the Jacobian
|
||||
//! The jacobian will be calculated from a numerical method
|
||||
//! The Jacobian will be calculated from a numerical method
|
||||
#define NSOLN_JAC_NUM 1
|
||||
//! The jacobian is calculated from an analytical function
|
||||
//! The Jacobian is calculated from an analytical function
|
||||
#define NSOLN_JAC_ANAL 2
|
||||
//@}
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ class NonlinearSolver
|
|||
public:
|
||||
//! Default constructor
|
||||
/*!
|
||||
* @param func Residual and jacobian evaluator function object
|
||||
* @param func Residual and Jacobian evaluator function object
|
||||
*/
|
||||
NonlinearSolver(ResidJacEval* func);
|
||||
|
||||
|
|
@ -216,9 +216,9 @@ public:
|
|||
* current values of the solution vector, m_y_n, and the solution time
|
||||
* derivative, m_ydot_n. The Jacobian is not recomputed.
|
||||
*
|
||||
* A factored jacobian is reused, if available. If a factored jacobian
|
||||
* is not available, then the jacobian is factored. Before factoring,
|
||||
* the jacobian is row and column-scaled. Column scaling is not
|
||||
* A factored Jacobian is reused, if available. If a factored Jacobian
|
||||
* is not available, then the Jacobian is factored. Before factoring,
|
||||
* the Jacobian is row and column-scaled. Column scaling is not
|
||||
* recomputed. The row scales are recomputed here, after column
|
||||
* scaling has been implemented.
|
||||
*
|
||||
|
|
@ -228,14 +228,14 @@ public:
|
|||
* @param delta_y return value of the raw change in y
|
||||
* @param jac Jacobian
|
||||
*
|
||||
* @return Returns the result code from lapack. A zero means success.
|
||||
* @return Returns the result code from LAPACK. A zero means success.
|
||||
* Anything else indicates a failure.
|
||||
*/
|
||||
int doNewtonSolve(const doublereal time_curr, const doublereal* const y_curr,
|
||||
const doublereal* const ydot_curr, doublereal* const delta_y,
|
||||
GeneralMatrix& jac);
|
||||
|
||||
//! Compute the newton step, either by direct newton's or by solving a
|
||||
//! Compute the Newton step, either by direct Newton's or by solving a
|
||||
//! close problem that is represented by a Hessian
|
||||
/*!
|
||||
* This is algorith A.6.5.1 in Dennis / Schnabel
|
||||
|
|
@ -247,9 +247,9 @@ public:
|
|||
* solution vector, m_y_n, and the solution time derivative, m_ydot_n.
|
||||
* The Jacobian is not recomputed.
|
||||
*
|
||||
* A factored jacobian is reused, if available. If a factored jacobian
|
||||
* is not available, then the jacobian is factored. Before factoring,
|
||||
* the jacobian is row and column-scaled. Column scaling is not
|
||||
* A factored Jacobian is reused, if available. If a factored Jacobian
|
||||
* is not available, then the Jacobian is factored. Before factoring,
|
||||
* the Jacobian is row and column-scaled. Column scaling is not
|
||||
* recomputed. The row scales are recomputed here, after column
|
||||
* scaling has been implemented.
|
||||
*
|
||||
|
|
@ -262,7 +262,7 @@ public:
|
|||
* ---------------
|
||||
* internal m_resid Stored residual is used as input
|
||||
*
|
||||
* @return Returns the result code from lapack. A zero means success. Anything
|
||||
* @return Returns the result code from LAPACK. A zero means success. Anything
|
||||
* else indicates a failure.
|
||||
*/
|
||||
int doAffineNewtonSolve(const doublereal* const y_curr, const doublereal* const ydot_curr,
|
||||
|
|
@ -349,9 +349,9 @@ public:
|
|||
* couldn't possibly be representative if the
|
||||
* variable is changed by a lot. (true for
|
||||
* nonlinear systems, false for linear systems)
|
||||
* Maximum increase in variable in any one newton iteration:
|
||||
* Maximum increase in variable in any one Newton iteration:
|
||||
* factor of 2
|
||||
* Maximum decrease in variable in any one newton iteration:
|
||||
* Maximum decrease in variable in any one Newton iteration:
|
||||
* factor of 5
|
||||
*
|
||||
* @param y Current solution value of the old step
|
||||
|
|
@ -386,18 +386,18 @@ public:
|
|||
*/
|
||||
void calc_ydot(const int order, const doublereal* const y_curr, doublereal* const ydot_curr) const;
|
||||
|
||||
//! Function called to evaluate the jacobian matrix and the current
|
||||
//! Function called to evaluate the Jacobian matrix and the current
|
||||
//! residual vector at the current time step
|
||||
/*!
|
||||
* @param J Jacobian matrix to be filled in
|
||||
* @param f Right hand side. This routine returns the current
|
||||
* value of the rhs (output), so that it does
|
||||
* value of the RHS (output), so that it does
|
||||
* not have to be computed again.
|
||||
* @param time_curr Current time
|
||||
* @param CJ inverse of the value of deltaT
|
||||
* @param y value of the solution vector
|
||||
* @param ydot value of the time derivative of the solution vector
|
||||
* @param num_newt_its Number of newton iterations
|
||||
* @param num_newt_its Number of Newton iterations
|
||||
*
|
||||
* @return Returns a flag to indicate that operation is successful.
|
||||
* 1 Means a successful operation
|
||||
|
|
@ -429,12 +429,12 @@ public:
|
|||
doublereal* const ydot_current);
|
||||
|
||||
//! Return the factor by which the undamped Newton step 'step0'
|
||||
//! must be multiplied in order to keep the update within the bounds of an accurate jacobian.
|
||||
//! must be multiplied in order to keep the update within the bounds of an accurate Jacobian.
|
||||
/*!
|
||||
* The idea behind these is that the Jacobian couldn't possibly be representative, if the
|
||||
* variable is changed by a lot. (true for nonlinear systems, false for linear systems)
|
||||
* Maximum increase in variable in any one newton iteration: factor of 1.5
|
||||
* Maximum decrease in variable in any one newton iteration: factor of 2
|
||||
* Maximum increase in variable in any one Newton iteration: factor of 1.5
|
||||
* Maximum decrease in variable in any one Newton iteration: factor of 2
|
||||
*
|
||||
* @param y Initial value of the solution vector
|
||||
* @param step0 initial proposed step size
|
||||
|
|
@ -501,8 +501,8 @@ public:
|
|||
* converged value of the solution derivative.
|
||||
* @param CJ Inverse of the value of deltaT
|
||||
* @param time_curr Current value of the time
|
||||
* @param jac Matrix that will be used to store the jacobian
|
||||
* @param num_newt_its Number of newton iterations taken
|
||||
* @param jac Matrix that will be used to store the Jacobian
|
||||
* @param num_newt_its Number of Newton iterations taken
|
||||
* @param num_linear_solves Number of linear solves taken
|
||||
* @param num_backtracks Number of backtracking steps taken
|
||||
* @param loglevelInput Input log level determines the amount of printing.
|
||||
|
|
@ -679,9 +679,9 @@ public:
|
|||
*/
|
||||
void setResidualTols(double residRtol, double* residAtol, int residNormHandling = 2);
|
||||
|
||||
//! Set the value of the maximum # of newton iterations
|
||||
//! Set the value of the maximum # of Newton iterations
|
||||
/*!
|
||||
* @param maxNewtIts Maximum number of newton iterations
|
||||
* @param maxNewtIts Maximum number of Newton iterations
|
||||
*/
|
||||
void setMaxNewtIts(const int maxNewtIts);
|
||||
|
||||
|
|
@ -716,7 +716,7 @@ public:
|
|||
*
|
||||
* The theoretical linearized residual decline
|
||||
* The actual residual decline in the steepest descent direction determined by numerical differencing
|
||||
* The actual residual decline in the newton direction determined by numerical differencing
|
||||
* The actual residual decline in the Newton direction determined by numerical differencing
|
||||
*
|
||||
* This routine doesn't need to be called for the solution of the nonlinear problem.
|
||||
*
|
||||
|
|
@ -785,7 +785,7 @@ public:
|
|||
* @param ydot_n_1 INPUT First trial value of the derivative of the solution vector
|
||||
* @param stepNorm_1 OUTPUT Norm of the vector step_1
|
||||
* @param stepNorm_2 OUTPUT Estimated norm of the vector step_2
|
||||
* @param jac INPUT jacobian
|
||||
* @param jac INPUT Jacobian
|
||||
* @param num_backtracks OUTPUT number of backtracks taken in the current damping step
|
||||
*
|
||||
* @return 1 Successful step was taken. The predicted residual norm is less than one
|
||||
|
|
@ -840,7 +840,7 @@ public:
|
|||
* @param alpha Relative distance along the particular curve.
|
||||
*
|
||||
* @return Returns the expected value of the residual at that point according to the quadratic model.
|
||||
* The residual at the newton point will always be zero.
|
||||
* The residual at the Newton point will always be zero.
|
||||
*/
|
||||
doublereal expectedResidLeg(int leg, doublereal alpha) const;
|
||||
|
||||
|
|
@ -891,7 +891,7 @@ public:
|
|||
*/
|
||||
private:
|
||||
|
||||
//! Pointer to the residual and jacobian evaluator for the
|
||||
//! Pointer to the residual and Jacobian evaluator for the
|
||||
//! function
|
||||
/*!
|
||||
* See ResidJacEval.h for an evaluator.
|
||||
|
|
@ -944,13 +944,13 @@ private:
|
|||
//! Weights for normalizing the values of the residuals
|
||||
/*!
|
||||
* These are computed if row scaling, m_rowScaling, is turned on. They are calculated currently as the
|
||||
* sum of the absolute values of the rows of the jacobian.
|
||||
* sum of the absolute values of the rows of the Jacobian.
|
||||
*/
|
||||
std::vector<doublereal> m_rowScales;
|
||||
|
||||
//! Weights for normalizing the values of the residuals
|
||||
/*!
|
||||
* They are calculated as the sum of the absolute values of the jacobian
|
||||
* They are calculated as the sum of the absolute values of the Jacobian
|
||||
* multiplied by the solution weight function.
|
||||
* This is carried out in scaleMatrix().
|
||||
*/
|
||||
|
|
@ -989,7 +989,7 @@ private:
|
|||
//! Norm of the solution update created by the iteration in its raw, undamped form, using the solution norm
|
||||
doublereal m_normDeltaSoln_Newton;
|
||||
|
||||
//! Norm of the distance to the cauchy point using the solution norm
|
||||
//! Norm of the distance to the Cauchy point using the solution norm
|
||||
doublereal m_normDeltaSoln_CP;
|
||||
|
||||
//! Norm of the residual for a trial calculation which may or may not be used
|
||||
|
|
@ -1044,15 +1044,15 @@ private:
|
|||
//! Number of local linear solves done during the current iteration
|
||||
int m_numLocalLinearSolves;
|
||||
|
||||
//! Total number of newton iterations
|
||||
//! Total number of Newton iterations
|
||||
int m_numTotalNewtIts;
|
||||
|
||||
public:
|
||||
//! Minimum number of newton iterations to use
|
||||
//! Minimum number of Newton iterations to use
|
||||
int m_min_newt_its;
|
||||
private:
|
||||
|
||||
//! Maximum number of newton iterations
|
||||
//! Maximum number of Newton iterations
|
||||
int maxNewtIts_;
|
||||
|
||||
//! Jacobian formation method
|
||||
|
|
@ -1123,9 +1123,9 @@ private:
|
|||
//! Scale factor for turning residual norms into solution norms
|
||||
doublereal m_ScaleSolnNormToResNorm;
|
||||
|
||||
//! Copy of the jacobian that doesn't get overwritten when the inverse is determined
|
||||
//! Copy of the Jacobian that doesn't get overwritten when the inverse is determined
|
||||
/*!
|
||||
* The jacobian stored here is the raw matrix, before any row or column scaling is carried out
|
||||
* The Jacobian stored here is the raw matrix, before any row or column scaling is carried out
|
||||
*/
|
||||
Cantera::GeneralMatrix* jacCopyPtr_;
|
||||
|
||||
|
|
@ -1139,7 +1139,7 @@ private:
|
|||
//! Steepest descent direction. This is also the distance to the Cauchy Point
|
||||
std::vector<doublereal> deltaX_CP_;
|
||||
|
||||
//! Newton Step - This is the newton step determined from the straight Jacobian
|
||||
//! Newton Step - This is the Newton step determined from the straight Jacobian
|
||||
/*
|
||||
* Newton step for the current step only
|
||||
*/
|
||||
|
|
@ -1246,7 +1246,7 @@ private:
|
|||
//! Expected DResid_dS for the Newton path - output variable
|
||||
doublereal ResidDecreaseNewtExp_;
|
||||
|
||||
//! Actual DResid_dS for the newton path - output variable
|
||||
//! Actual DResid_dS for the Newton path - output variable
|
||||
doublereal ResidDecreaseNewt_;
|
||||
|
||||
/*******************************************************************************************
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public:
|
|||
* @param resid Value of the residual that is computed (output)
|
||||
* @param evalType Type of the residual being computed (defaults to Base_ResidEval)
|
||||
* @param id_x Index of the variable that is being numerically differenced to find
|
||||
* the jacobian (defaults to -1, which indicates that no variable is being
|
||||
* the Jacobian (defaults to -1, which indicates that no variable is being
|
||||
* differenced or that the residual doesn't take this issue into account)
|
||||
* @param delta_x Value of the delta used in the numerical differencing
|
||||
*
|
||||
|
|
@ -186,7 +186,7 @@ public:
|
|||
* @param t Time (input)
|
||||
* @param y Solution vector (input, do not modify)
|
||||
* @param ydot Rate of change of solution vector. (input, do not modify)
|
||||
* @param delta_y Value of the delta to be used in calculating the numerical jacobian
|
||||
* @param delta_y Value of the delta to be used in calculating the numerical Jacobian
|
||||
* @param solnWeights Value of the solution weights that are used in determining convergence (default = 0)
|
||||
*
|
||||
* @return Returns a flag to indicate that operation is successful.
|
||||
|
|
@ -245,7 +245,7 @@ public:
|
|||
|
||||
//! Multiply the matrix by another matrix that leads to better conditioning
|
||||
/*!
|
||||
* Provide a left sided matrix that will multiply the current jacobian, after scaling
|
||||
* Provide a left sided matrix that will multiply the current Jacobian, after scaling
|
||||
* and lead to a better conditioned system.
|
||||
* This routine is called just before the matrix is factored.
|
||||
*
|
||||
|
|
@ -255,9 +255,9 @@ public:
|
|||
* New problem:
|
||||
* M (J delta_x) = - M Resid
|
||||
*
|
||||
* @param matrix Pointer to the current jacobian (if zero, it's already been factored)
|
||||
* @param matrix Pointer to the current Jacobian (if zero, it's already been factored)
|
||||
* @param nrows offsets for the matrix
|
||||
* @param rhs residual vector. This also needs to be lhs multiplied by M
|
||||
* @param rhs residual vector. This also needs to be LHS multiplied by M
|
||||
*
|
||||
* @return Returns a flag to indicate that operation is successful.
|
||||
* 1 Means a successful operation
|
||||
|
|
@ -266,13 +266,13 @@ public:
|
|||
virtual int matrixConditioning(doublereal* const matrix, const int nrows,
|
||||
doublereal* const rhs);
|
||||
|
||||
//! Calculate an analytical jacobian and the residual at the current time and values.
|
||||
//! Calculate an analytical Jacobian and the residual at the current time and values.
|
||||
/*!
|
||||
* Only called if the jacFormation method is set to analytical
|
||||
*
|
||||
* @param t Time (input)
|
||||
* @param delta_t The current value of the time step (input)
|
||||
* @param cj Coefficient of yprime used in the evaluation of the jacobian
|
||||
* @param cj Coefficient of yprime used in the evaluation of the Jacobian
|
||||
* @param y Solution vector (input, do not modify)
|
||||
* @param ydot Rate of change of solution vector. (input, do not modify)
|
||||
* @param J Reference to the SquareMatrix object to be calculated (output)
|
||||
|
|
@ -286,13 +286,13 @@ public:
|
|||
const doublereal* const y, const doublereal* const ydot,
|
||||
GeneralMatrix& J, doublereal* const resid);
|
||||
|
||||
//! Calculate an analytical jacobian and the residual at the current time and values.
|
||||
//! Calculate an analytical Jacobian and the residual at the current time and values.
|
||||
/*!
|
||||
* Only called if the jacFormation method is set to analytical
|
||||
*
|
||||
* @param t Time (input)
|
||||
* @param delta_t The current value of the time step (input)
|
||||
* @param cj Coefficient of yprime used in the evaluation of the jacobian
|
||||
* @param cj Coefficient of yprime used in the evaluation of the Jacobian
|
||||
* @param y Solution vector (input, do not modify)
|
||||
* @param ydot Rate of change of solution vector. (input, do not modify)
|
||||
* @param jacobianColPts Pointer to the vector of pts to columns of the SquareMatrix
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
* algorithm to determine when to shut off
|
||||
* time-stepping.
|
||||
* 3: SOLVEPROB_JACOBIAN = Calculation of the surface problem is due to the
|
||||
* need for a numerical jacobian for the gas-problem.
|
||||
* need for a numerical Jacobian for the gas-problem.
|
||||
* The solution is expected to be very close to the
|
||||
* initial guess, and accuracy is needed.
|
||||
* 4: SOLVEPROB_TRANSIENT = The transient calculation is performed here for an
|
||||
|
|
@ -97,11 +97,11 @@ namespace Cantera
|
|||
* time-stepping.
|
||||
*
|
||||
* 3: SOLVEPROB_JACOBIAN = Calculation of the surface problem is due to the
|
||||
* need for a numerical jacobian for the gas-problem.
|
||||
* need for a numerical Jacobian for the gas-problem.
|
||||
* The solution is expected to be very close to the
|
||||
* initial guess, and extra accuracy is needed because
|
||||
* solution variables have been delta'd from
|
||||
* nominal values to create jacobian entries.
|
||||
* nominal values to create Jacobian entries.
|
||||
*
|
||||
* 4: SOLVEPROB_TRANSIENT = The transient calculation is performed here for an
|
||||
* amount of time specified by "time_scale". It is
|
||||
|
|
@ -309,7 +309,7 @@ private:
|
|||
* @param resid output Vector of residuals, length = m_neq
|
||||
* @param CSolnSP Vector of species concentrations, unknowns in the
|
||||
* problem, length = m_neq. These are tweaked in order
|
||||
* to derive the columns of the jacobian.
|
||||
* to derive the columns of the Jacobian.
|
||||
* @param CSolnSPOld Old Vector of species concentrations, unknowns in the
|
||||
* problem, length = m_neq
|
||||
* @param do_time Calculate a time dependent residual
|
||||
|
|
@ -416,7 +416,7 @@ private:
|
|||
*/
|
||||
vector_fp m_resid;
|
||||
|
||||
//! Vector of pointers to the top of the columns of the jacobians
|
||||
//! Vector of pointers to the top of the columns of the Jacobians
|
||||
/*!
|
||||
* The "dim" by "dim" computed Jacobian matrix for the
|
||||
* local Newton's method.
|
||||
|
|
|
|||
|
|
@ -70,10 +70,10 @@ public:
|
|||
void incrementDiagonal(int j, doublereal d);
|
||||
|
||||
protected:
|
||||
//! Residual evaluator for this jacobian
|
||||
//! Residual evaluator for this Jacobian
|
||||
/*!
|
||||
* This is a pointer to the residual evaluator. This object isn't owned
|
||||
* by this jacobian object.
|
||||
* by this Jacobian object.
|
||||
*/
|
||||
OneDim* m_resid;
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ public:
|
|||
//! state of the species at the current <I>T</I> and <I>P</I> of the solution
|
||||
/*!
|
||||
* Units are Joules/kmol
|
||||
* @param gpure Output vector of standard state gibbs free energies
|
||||
* @param gpure Output vector of standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getPureGibbs(doublereal* gpure) const {
|
||||
|
|
@ -181,7 +181,7 @@ public:
|
|||
//! Get the nondimensional Gibbs functions for the species
|
||||
//! in their standard states at the current <I>T</I> and <I>P</I> of the solution.
|
||||
/*!
|
||||
* @param grt Output vector of nondimensional standard state gibbs free energies
|
||||
* @param grt Output vector of nondimensional standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getGibbs_RT(doublereal* grt) const {
|
||||
|
|
@ -312,7 +312,7 @@ protected:
|
|||
//! Temporary storage for dimensionless reference state heat capacities
|
||||
mutable vector_fp m_cp0_R;
|
||||
|
||||
//! Temporary storage for dimensionless reference state gibbs energies
|
||||
//! Temporary storage for dimensionless reference state Gibbs energies
|
||||
mutable vector_fp m_g0_RT;
|
||||
|
||||
//! Temporary storage for dimensionless reference state entropies
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class PDSS_Water;
|
|||
* \f]
|
||||
*
|
||||
* The standard state heat capacity and entropy are independent
|
||||
* of pressure. The standard state gibbs free energy is obtained
|
||||
* of pressure. The standard state Gibbs free energy is obtained
|
||||
* from the enthalpy and entropy functions.
|
||||
*
|
||||
* The vector Phase::m_speciesSize[] is used to hold the
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ namespace Cantera
|
|||
* <b> Instantiation of the Class </b>
|
||||
*
|
||||
* This phase may be instantiated by calling the default ThermoFactory routine
|
||||
* for %Cantera. This new FixedChemPotSSTP object must then have a standalone xml file
|
||||
* for %Cantera. This new FixedChemPotSSTP object must then have a standalone XML file
|
||||
* description an example of which is given below.
|
||||
*
|
||||
* It may also be created by the following code snippets. The code
|
||||
|
|
@ -392,7 +392,7 @@ public:
|
|||
//! Get the nondimensional Gibbs functions for the species
|
||||
//! in their standard states at the current <I>T</I> and <I>P</I> of the solution.
|
||||
/*!
|
||||
* @param grt Output vector of nondimensional standard state gibbs free energies
|
||||
* @param grt Output vector of nondimensional standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getGibbs_RT(doublereal* grt) const;
|
||||
|
|
@ -474,7 +474,7 @@ public:
|
|||
|
||||
/*!
|
||||
* Returns the vector of the
|
||||
* gibbs function of the reference state at the current temperature
|
||||
* Gibbs function of the reference state at the current temperature
|
||||
* of the solution and the reference pressure for the species.
|
||||
* units = J/kmol
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @file GibbsExcessVPSSTP.h
|
||||
* Header for intermediate ThermoPhase object for phases which
|
||||
* employ gibbs excess free energy based formulations
|
||||
* employ Gibbs excess free energy based formulations
|
||||
* (see \ref thermoprops
|
||||
* and class \link Cantera::GibbsExcessVPSSTP GibbsExcessVPSSTP\endlink).
|
||||
*
|
||||
|
|
@ -124,7 +124,7 @@ public:
|
|||
|
||||
//! Duplication routine for objects which inherit from ThermoPhase.
|
||||
/*!
|
||||
* This virtual routine can be used to duplicate thermophase objects
|
||||
* This virtual routine can be used to duplicate ThermoPhase objects
|
||||
* inherited from ThermoPhase even if the application only has
|
||||
* a pointer to ThermoPhase to work with.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ class WaterProps;
|
|||
*
|
||||
*
|
||||
* The solute standard state heat capacity and entropy are independent
|
||||
* of pressure. The solute standard state gibbs free energy is obtained
|
||||
* of pressure. The solute standard state Gibbs free energy is obtained
|
||||
* from the enthalpy and entropy functions.
|
||||
*
|
||||
* The vector Phase::m_speciesSize[] is used to hold the
|
||||
|
|
@ -297,8 +297,8 @@ class WaterProps;
|
|||
*
|
||||
* <H3> Specification of the Excess Gibbs Free Energy </H3>
|
||||
*
|
||||
* Pitzer's formulation may best be represented as a specification of the excess gibbs
|
||||
* free energy, \f$ G^{ex} \f$, defined as the deviation of the total gibbs free energy from
|
||||
* Pitzer's formulation may best be represented as a specification of the excess Gibbs
|
||||
* free energy, \f$ G^{ex} \f$, defined as the deviation of the total Gibbs free energy from
|
||||
* that of an ideal molal solution.
|
||||
* \f[
|
||||
* G = G^{id} + G^{ex}
|
||||
|
|
@ -577,7 +577,7 @@ class WaterProps;
|
|||
* below the critical temperature of water.
|
||||
* They found a temperature functional form for fitting the 3 following
|
||||
* coefficients that describe the Pitzer parameterization for a single salt
|
||||
* to be adequate to describe how the excess gibbs free energy values for
|
||||
* to be adequate to describe how the excess Gibbs free energy values for
|
||||
* the binary salt changes with respect to temperature.
|
||||
* The following functional form
|
||||
* was used to fit the temperature dependence of the Pitzer Coefficients
|
||||
|
|
@ -1308,7 +1308,7 @@ public:
|
|||
* about the species, including their reference state thermodynamic
|
||||
* polynomials. We then freeze the state of the species.
|
||||
*
|
||||
* Then, we read the species molar volumes from the xml tree to finish the
|
||||
* Then, we read the species molar volumes from the XML tree to finish the
|
||||
* initialization.
|
||||
*
|
||||
* @param phaseNode This object must be the phase node of a complete XML tree
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ namespace Cantera
|
|||
* \f[
|
||||
* S^o_k(T,P) = S^{ref}_k(T) - R \ln(\frac{P}{P_{ref}})
|
||||
* \f]
|
||||
* The standard state gibbs free energy is obtained from the enthalpy and entropy
|
||||
* The standard state Gibbs free energy is obtained from the enthalpy and entropy
|
||||
* functions:
|
||||
*
|
||||
* \f[
|
||||
|
|
@ -690,7 +690,7 @@ public:
|
|||
//! Get the nondimensional Gibbs functions for the species
|
||||
//! standard states at the current <I>T</I> and <I>P</I> of the solution.
|
||||
/*!
|
||||
* @param grt Output vector of nondimensional standard state gibbs free energies
|
||||
* @param grt Output vector of nondimensional standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getGibbs_RT(doublereal* grt) const;
|
||||
|
|
@ -699,7 +699,7 @@ public:
|
|||
//! state of the species at the current <I>T</I> and <I>P</I> of the solution
|
||||
/*!
|
||||
* Units are Joules/kmol
|
||||
* @param gpure Output vector of standard state gibbs free energies
|
||||
* @param gpure Output vector of standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getPureGibbs(doublereal* gpure) const;
|
||||
|
|
@ -754,7 +754,7 @@ public:
|
|||
virtual void getGibbs_RT_ref(doublereal* grt) const;
|
||||
|
||||
//! Returns the vector of the
|
||||
//! gibbs function of the reference state at the current temperature
|
||||
//! Gibbs function of the reference state at the current temperature
|
||||
//! of the solution and the reference pressure for the species.
|
||||
/*!
|
||||
* units = J/kmol
|
||||
|
|
@ -899,7 +899,7 @@ protected:
|
|||
//! Temporary storage for dimensionless reference state heat capacities
|
||||
mutable vector_fp m_cp0_R;
|
||||
|
||||
//! Temporary storage for dimensionless reference state gibbs energies
|
||||
//! Temporary storage for dimensionless reference state Gibbs energies
|
||||
mutable vector_fp m_g0_RT;
|
||||
|
||||
//! Temporary storage for dimensionless reference state entropies
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ public:
|
|||
|
||||
//! Molar Gibbs function for the solution: Units J/kmol.
|
||||
/*!
|
||||
* Returns the gibbs free energy of the solution per mole of the solution.
|
||||
* Returns the Gibbs free energy of the solution per mole of the solution.
|
||||
*
|
||||
* \f[
|
||||
* \bar{g}(T, P, X_k) = \sum_k X_k \mu_k(T)
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public:
|
|||
* Constructor for IdealSolidSolnPhase.
|
||||
* The generalized concentrations can have three different forms
|
||||
* depending on the value of the member attribute #m_formGC, which
|
||||
* is supplied in the constructor or read from the xml data file.
|
||||
* is supplied in the constructor or read from the XML data file.
|
||||
*
|
||||
* @param formCG This parameter initializes the #m_formGC variable.
|
||||
*/
|
||||
|
|
@ -67,7 +67,7 @@ public:
|
|||
* This constructor will also fully initialize the object.
|
||||
* The generalized concentrations can have three different forms
|
||||
* depending on the value of the member attribute #m_formGC, which
|
||||
* is supplied in the constructor or read from the xml data file.
|
||||
* is supplied in the constructor or read from the XML data file.
|
||||
*
|
||||
* @param infile File name for the XML datafile containing information
|
||||
* for this phase
|
||||
|
|
@ -146,15 +146,15 @@ public:
|
|||
virtual doublereal entropy_mole() const;
|
||||
|
||||
/**
|
||||
* Molar gibbs free energy of the solution. Units: J/kmol.
|
||||
* Molar Gibbs free energy of the solution. Units: J/kmol.
|
||||
* For an ideal, constant partial molar volume solution mixture with
|
||||
* pure species phases which exhibit zero volume expansivity:
|
||||
* \f[
|
||||
* \hat g(T, P) = \sum_k X_k \hat g^0_k(T,P) + \hat R T \sum_k X_k log(X_k)
|
||||
* \f]
|
||||
* The reference-state pure-species gibbs free energies
|
||||
* The reference-state pure-species Gibbs free energies
|
||||
* \f$ \hat g^0_k(T) \f$ are computed by the species thermodynamic
|
||||
* property manager, while the standard state gibbs free energies
|
||||
* property manager, while the standard state Gibbs free energies
|
||||
* \f$ \hat g^0_k(T,P) \f$ are computed by the member function, gibbs_RT().
|
||||
* @see SpeciesThermo
|
||||
*/
|
||||
|
|
@ -603,7 +603,7 @@ public:
|
|||
void getEntropy_R(doublereal* sr) const;
|
||||
|
||||
/**
|
||||
* Get the nondimensional gibbs function for the species
|
||||
* Get the nondimensional Gibbs function for the species
|
||||
* standard states at the current T and P of the solution.
|
||||
*
|
||||
* \f[
|
||||
|
|
@ -615,7 +615,7 @@ public:
|
|||
*
|
||||
* @param grt Vector of length m_kk, which on return sr[k]
|
||||
* will contain the nondimensional
|
||||
* standard state gibbs function for species k.
|
||||
* standard state Gibbs function for species k.
|
||||
*/
|
||||
virtual void getGibbs_RT(doublereal* grt) const;
|
||||
|
||||
|
|
@ -697,7 +697,7 @@ public:
|
|||
|
||||
/**
|
||||
* Returns the vector of the
|
||||
* gibbs function of the reference state at the current temperature
|
||||
* Gibbs function of the reference state at the current temperature
|
||||
* of the solution and the reference pressure for the species.
|
||||
* units = J/kmol
|
||||
*
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ enum IonSolnType_enumType {
|
|||
* for the same phase expressed in terms of combinations of the
|
||||
* ionic species that represent neutral molecules. It's expected
|
||||
* that the neutral molecules will be represented in terms of
|
||||
* an excess gibbs free energy approximation that is a derivative
|
||||
* an excess Gibbs free energy approximation that is a derivative
|
||||
* of the GbbsExcessVPSSTP object. All of the e Excess Gibbs free
|
||||
* energy formulations in this area employ
|
||||
* symmetrical formulations.
|
||||
|
|
@ -156,7 +156,7 @@ public:
|
|||
/// the phase and setting its parameters from a specification in an
|
||||
/// input file.
|
||||
|
||||
//! Initialization of an IonsFromNeutralVPSSTP phase using an xml file
|
||||
//! Initialization of an IonsFromNeutralVPSSTP phase using an XML file
|
||||
/*!
|
||||
* This routine is a precursor to initThermo(XML_Node*)
|
||||
* routine, which does most of the work.
|
||||
|
|
@ -179,7 +179,7 @@ public:
|
|||
* reference state thermodynamic polynomials. We then freeze
|
||||
* the state of the species.
|
||||
*
|
||||
* Then, we read the species molar volumes from the xml
|
||||
* Then, we read the species molar volumes from the XML
|
||||
* tree to finish the initialization.
|
||||
*
|
||||
* @param phaseNode This object must be the phase node of a complete XML tree
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ namespace Cantera
|
|||
* \f]
|
||||
*
|
||||
* The standard state heat capacity, internal energy, and entropy are independent
|
||||
* of pressure. The standard state gibbs free energy is obtained
|
||||
* of pressure. The standard state Gibbs free energy is obtained
|
||||
* from the enthalpy and entropy functions.
|
||||
*
|
||||
* The standard state molar volume is independent of temperature, pressure,
|
||||
|
|
@ -595,7 +595,7 @@ public:
|
|||
//! state of the species at the current <I>T</I> and <I>P</I> of the solution
|
||||
/*!
|
||||
* Units are Joules/kmol
|
||||
* @param gpure Output vector of standard state gibbs free energies
|
||||
* @param gpure Output vector of standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getPureGibbs(doublereal* gpure) const;
|
||||
|
|
@ -647,14 +647,14 @@ public:
|
|||
//! Get the nondimensional Gibbs functions for the species
|
||||
//! standard states at the current <I>T</I> and <I>P</I> of the solution.
|
||||
/*!
|
||||
* The standard gibbs free energies are obtained from the enthalpy
|
||||
* The standard Gibbs free energies are obtained from the enthalpy
|
||||
* and entropy formulation.
|
||||
*
|
||||
* \f[
|
||||
* g^o_k(T,P) = h^{o}_k(T,P) - T s^{o}_k(T,P)
|
||||
* \f]
|
||||
*
|
||||
* @param grt Output vector of nondimensional standard state gibbs free energies
|
||||
* @param grt Output vector of nondimensional standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getGibbs_RT(doublereal* grt) const;
|
||||
|
|
@ -719,7 +719,7 @@ public:
|
|||
*/
|
||||
virtual void getGibbs_RT_ref(doublereal* grt) const;
|
||||
|
||||
//! Returns the vector of the gibbs function of the reference state at the current temperature
|
||||
//! Returns the vector of the Gibbs function of the reference state at the current temperature
|
||||
//! of the solution and the reference pressure for the species.
|
||||
/*!
|
||||
* units = J/kmol
|
||||
|
|
@ -858,7 +858,7 @@ protected:
|
|||
//! Temporary storage for the reference state heat capacities
|
||||
mutable vector_fp m_cp0_R;
|
||||
|
||||
//! Temporary storage for the reference state gibbs energies
|
||||
//! Temporary storage for the reference state Gibbs energies
|
||||
mutable vector_fp m_g0_RT;
|
||||
|
||||
//! Temporary storage for the reference state entropies at the current temperature
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ public:
|
|||
|
||||
//! Return the Molar Gibbs energy. Units: J/kmol.
|
||||
/*!
|
||||
* The molar gibbs free energy is determined by the following formula, where \f$ \theta_n \f$ is the
|
||||
* The molar Gibbs free energy is determined by the following formula, where \f$ \theta_n \f$ is the
|
||||
* lattice stoichiometric coefficient of the nth lattice
|
||||
*
|
||||
* \f[
|
||||
|
|
@ -545,7 +545,7 @@ public:
|
|||
/*!
|
||||
* This function fills in its one entry in hrt[] by calling
|
||||
* the underlying species thermo function for the
|
||||
* dimensionless gibbs free energy, calculated from the
|
||||
* dimensionless Gibbs free energy, calculated from the
|
||||
* dimensionless enthalpy and entropy.
|
||||
*
|
||||
* @param grt Vector of dimensionless Gibbs free energies of the reference state
|
||||
|
|
@ -553,13 +553,13 @@ public:
|
|||
*/
|
||||
virtual void getGibbs_RT_ref(doublereal* grt) const;
|
||||
|
||||
//! Returns the vector of the gibbs function of the reference state at the current
|
||||
//! Returns the vector of the Gibbs function of the reference state at the current
|
||||
//! temperatureof the solution and the reference pressure for the species.
|
||||
/*!
|
||||
* units = J/kmol
|
||||
*
|
||||
* This function fills in its one entry in g[] by calling the underlying species thermo
|
||||
* functions for the gibbs free energy, calculated from enthalpy and the
|
||||
* functions for the Gibbs free energy, calculated from enthalpy and the
|
||||
* entropy, and the multiplying by RT.
|
||||
*
|
||||
* @param g Vector of Gibbs free energies of the reference state.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @file MargulesVPSSTP.h
|
||||
* Header for intermediate ThermoPhase object for phases which
|
||||
* employ gibbs excess free energy based formulations
|
||||
* employ Gibbs excess free energy based formulations
|
||||
* (see \ref thermoprops
|
||||
* and class \link Cantera::MargulesVPSSTP MargulesVPSSTP\endlink).
|
||||
*
|
||||
|
|
@ -29,13 +29,13 @@ namespace Cantera
|
|||
*/
|
||||
|
||||
//! MargulesVPSSTP is a derived class of GibbsExcessVPSSTP that employs
|
||||
//! the Margules approximation for the excess gibbs free energy
|
||||
//! the Margules approximation for the excess Gibbs free energy
|
||||
/*!
|
||||
*
|
||||
* MargulesVPSSTP derives from class GibbsExcessVPSSTP which is derived
|
||||
* from VPStandardStateTP,
|
||||
* and overloads the virtual methods defined there with ones that
|
||||
* use expressions appropriate for the Margules Excess gibbs free energy
|
||||
* use expressions appropriate for the Margules Excess Gibbs free energy
|
||||
* approximation.
|
||||
*
|
||||
* The independent unknowns are pressure, temperature, and mass fraction.
|
||||
|
|
@ -270,7 +270,7 @@ public:
|
|||
MargulesVPSSTP();
|
||||
|
||||
//! Construct and initialize a MargulesVPSSTP ThermoPhase object
|
||||
//! directly from an xml input file
|
||||
//! directly from an XML input file
|
||||
/*!
|
||||
* Working constructors
|
||||
*
|
||||
|
|
@ -321,7 +321,7 @@ public:
|
|||
|
||||
//! Duplication routine for objects which inherit from ThermoPhase.
|
||||
/*!
|
||||
* This virtual routine can be used to duplicate thermophase objects
|
||||
* This virtual routine can be used to duplicate ThermoPhase objects
|
||||
* inherited from ThermoPhase even if the application only has
|
||||
* a pointer to ThermoPhase to work with.
|
||||
*/
|
||||
|
|
@ -668,51 +668,51 @@ protected:
|
|||
size_t numBinaryInteractions_;
|
||||
|
||||
//! Enthalpy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_HE_b_ij;
|
||||
|
||||
//! Enthalpy term for the ternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_HE_c_ij;
|
||||
|
||||
//! Enthalpy term for the quaternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_HE_d_ij;
|
||||
|
||||
//! Entropy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_SE_b_ij;
|
||||
|
||||
//! Entropy term for the ternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_SE_c_ij;
|
||||
|
||||
//! Entropy term for the quaternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_SE_d_ij;
|
||||
|
||||
//! Enthalpy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VHE_b_ij;
|
||||
|
||||
//! Enthalpy term for the ternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VHE_c_ij;
|
||||
|
||||
//! Enthalpy term for the quaternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VHE_d_ij;
|
||||
|
||||
//! Entropy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VSE_b_ij;
|
||||
|
||||
//! Entropy term for the ternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VSE_c_ij;
|
||||
|
||||
//! Entropy term for the quaternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VSE_d_ij;
|
||||
|
||||
//! vector of species indices representing species A in the interaction
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ public:
|
|||
//! state of the species at the current <I>T</I> and <I>P</I> of the solution
|
||||
/*!
|
||||
* Units are Joules/kmol
|
||||
* @param gpure Output vector of standard state gibbs free energies
|
||||
* @param gpure Output vector of standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getPureGibbs(doublereal* gpure) const;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ namespace Cantera
|
|||
* S^o_k(T,P) = S^{ref}_k(T) - R \ln(\frac{P}{P_{ref}})
|
||||
* \f]
|
||||
*
|
||||
* The standard state gibbs free energy is obtained from the enthalpy and entropy
|
||||
* The standard state Gibbs free energy is obtained from the enthalpy and entropy
|
||||
* functions:
|
||||
*
|
||||
* \f[
|
||||
|
|
@ -115,7 +115,7 @@ namespace Cantera
|
|||
* ThermoPhase *eMetal = newPhase("MetalSHEelectrons.xml", "MetalSHEelectrons");
|
||||
* @endcode
|
||||
*
|
||||
* Additionally, this phase may be created without including an xml file with
|
||||
* Additionally, this phase may be created without including an XML file with
|
||||
* the special command, where the default file is embedded into this object.
|
||||
*
|
||||
* @code
|
||||
|
|
@ -389,7 +389,7 @@ public:
|
|||
//! Get the nondimensional Gibbs functions for the species
|
||||
//! in their standard states at the current <I>T</I> and <I>P</I> of the solution.
|
||||
/*!
|
||||
* @param grt Output vector of nondimensional standard state gibbs free energies
|
||||
* @param grt Output vector of nondimensional standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getGibbs_RT(doublereal* grt) const;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ namespace Cantera
|
|||
* \f]
|
||||
*
|
||||
* The standard state heat capacity and entropy are independent
|
||||
* of pressure. The standard state gibbs free energy is obtained
|
||||
* of pressure. The standard state Gibbs free energy is obtained
|
||||
* from the enthalpy and entropy functions.
|
||||
*
|
||||
* <b> Specification of Solution Thermodynamic Properties </b>
|
||||
|
|
@ -305,7 +305,7 @@ public:
|
|||
//! Get the nondimensional Gibbs functions for the species
|
||||
//! in their standard states at the current <I>T</I> and <I>P</I> of the solution.
|
||||
/*!
|
||||
* @param grt Output vector of nondimensional standard state gibbs free energies
|
||||
* @param grt Output vector of nondimensional standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getGibbs_RT(doublereal* grt) const;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @file MixedSolventElectrolyte.h
|
||||
* Header for intermediate ThermoPhase object for phases which
|
||||
* employ gibbs excess free energy based formulations
|
||||
* employ Gibbs excess free energy based formulations
|
||||
* (see \ref thermoprops
|
||||
* and class \link Cantera::MargulesVPSSTP MargulesVPSSTP\endlink).
|
||||
*
|
||||
|
|
@ -29,13 +29,13 @@ namespace Cantera
|
|||
*/
|
||||
|
||||
//! MixedSolventElectrolyte is a derived class of GibbsExcessVPSSTP that employs
|
||||
//! the DH and local Marguless approximations for the excess gibbs free energy
|
||||
//! the DH and local Marguless approximations for the excess Gibbs free energy
|
||||
/*!
|
||||
*
|
||||
* MixedSolventElectrolyte derives from class GibbsExcessVPSSTP which is derived
|
||||
* from VPStandardStateTP,
|
||||
* and overloads the virtual methods defined there with ones that
|
||||
* use expressions appropriate for the Margules Excess gibbs free energy
|
||||
* use expressions appropriate for the Margules Excess Gibbs free energy
|
||||
* approximation.
|
||||
*
|
||||
* The independent unknowns are pressure, temperature, and mass fraction.
|
||||
|
|
@ -271,7 +271,7 @@ public:
|
|||
MixedSolventElectrolyte();
|
||||
|
||||
//! Construct and initialize a MixedSolventElectrolyte ThermoPhase object
|
||||
//! directly from an xml input file
|
||||
//! directly from an XML input file
|
||||
/*!
|
||||
* @param inputFile Name of the input file containing the phase XML data
|
||||
* to set up the object
|
||||
|
|
@ -313,7 +313,7 @@ public:
|
|||
|
||||
//! Duplication routine for objects which inherit from ThermoPhase.
|
||||
/*!
|
||||
* This virtual routine can be used to duplicate thermophase objects
|
||||
* This virtual routine can be used to duplicate ThermoPhase objects
|
||||
* inherited from ThermoPhase even if the application only has
|
||||
* a pointer to ThermoPhase to work with.
|
||||
*/
|
||||
|
|
@ -659,51 +659,51 @@ protected:
|
|||
size_t numBinaryInteractions_;
|
||||
|
||||
//! Enthalpy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_HE_b_ij;
|
||||
|
||||
//! Enthalpy term for the ternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_HE_c_ij;
|
||||
|
||||
//! Enthalpy term for the quaternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_HE_d_ij;
|
||||
|
||||
//! Entropy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_SE_b_ij;
|
||||
|
||||
//! Entropy term for the ternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_SE_c_ij;
|
||||
|
||||
//! Entropy term for the quaternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_SE_d_ij;
|
||||
|
||||
//! Enthalpy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VHE_b_ij;
|
||||
|
||||
//! Enthalpy term for the ternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VHE_c_ij;
|
||||
|
||||
//! Enthalpy term for the quaternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VHE_d_ij;
|
||||
|
||||
//! Entropy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VSE_b_ij;
|
||||
|
||||
//! Entropy term for the ternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VSE_c_ij;
|
||||
|
||||
//! Entropy term for the quaternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VSE_d_ij;
|
||||
|
||||
//! vector of species indices representing species A in the interaction
|
||||
|
|
|
|||
|
|
@ -496,7 +496,7 @@ protected:
|
|||
public:
|
||||
/*!
|
||||
* Returns the vector of the
|
||||
* gibbs function of the reference state at the current temperature
|
||||
* Gibbs function of the reference state at the current temperature
|
||||
* of the solution and the reference pressure for the species.
|
||||
* units = J/kmol
|
||||
*
|
||||
|
|
@ -830,7 +830,7 @@ protected:
|
|||
//! Temporary storage for dimensionless reference state heat capacities
|
||||
mutable vector_fp m_cp0_R;
|
||||
|
||||
//! Temporary storage for dimensionless reference state gibbs energies
|
||||
//! Temporary storage for dimensionless reference state Gibbs energies
|
||||
mutable vector_fp m_g0_RT;
|
||||
|
||||
//! Temporary storage for dimensionless reference state entropies
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @file MolarityIonicVPSSTP.h
|
||||
* Header for intermediate ThermoPhase object for phases which
|
||||
* employ gibbs excess free energy based formulations
|
||||
* employ Gibbs excess free energy based formulations
|
||||
* (see \ref thermoprops
|
||||
* and class \link Cantera::MolarityIonicVPSSTP MolarityIonicVPSSTP\endlink).
|
||||
*
|
||||
|
|
@ -103,7 +103,7 @@ public:
|
|||
|
||||
//! Duplication routine for objects which inherit from ThermoPhase.
|
||||
/*!
|
||||
* This virtual routine can be used to duplicate thermophase objects
|
||||
* This virtual routine can be used to duplicate ThermoPhase objects
|
||||
* inherited from ThermoPhase even if the application only has
|
||||
* a pointer to ThermoPhase to work with.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* on the NASA temperature polynomial form applied to two temperature regions
|
||||
* (see \ref spthermo and class \link Cantera::NasaPoly2 NasaPoly2\endlink).
|
||||
*
|
||||
* Two zoned Nasa polynomial parameterization
|
||||
* Two zoned NASA polynomial parameterization
|
||||
*/
|
||||
// Copyright 2001 California Institute of Technology
|
||||
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ public:
|
|||
//! the current pressure and the reference pressure, p0
|
||||
virtual doublereal entropyDelp_mole() const;
|
||||
|
||||
//! Get the difference in the standard state gibbs free energy
|
||||
//! Get the difference in the standard state Gibbs free energy
|
||||
//! between the current pressure and the reference pressure, p0.
|
||||
virtual doublereal gibbsDelp_mole() const;
|
||||
|
||||
|
|
@ -366,9 +366,9 @@ public:
|
|||
return m_maxTemp;
|
||||
}
|
||||
|
||||
//! Return the molar gibbs free energy divided by RT at reference pressure
|
||||
//! Return the molar Gibbs free energy divided by RT at reference pressure
|
||||
/*!
|
||||
* @return The reference state gibbs free energy at the current
|
||||
* @return The reference state Gibbs free energy at the current
|
||||
* temperature, divided by RT.
|
||||
*/
|
||||
virtual doublereal gibbs_RT_ref() const;
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ public:
|
|||
void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex,
|
||||
const std::string& inputFile, const std::string& id);
|
||||
|
||||
//! Initialization of a PDSS object using an xml tree
|
||||
//! Initialization of a PDSS object using an XML tree
|
||||
/*!
|
||||
* This routine is a driver for the initialization of the object.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ public:
|
|||
void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex,
|
||||
const std::string& inputFile, const std::string& id);
|
||||
|
||||
//! Initialization of a PDSS object using an xml tree
|
||||
//! Initialization of a PDSS object using an XML tree
|
||||
/*!
|
||||
* This routine is a driver for the initialization of the object.
|
||||
*
|
||||
|
|
@ -218,7 +218,7 @@ public:
|
|||
//@}
|
||||
|
||||
private:
|
||||
//! Main routine that actually calculates the gibbs free energy difference
|
||||
//! Main routine that actually calculates the Gibbs free energy difference
|
||||
//! between the reference state at Tr, Pr and T,P
|
||||
/*!
|
||||
* This is eEqn. 59 in Johnson et al. (1992).
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ public:
|
|||
void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex,
|
||||
const std::string& inputFile, const std::string& id);
|
||||
|
||||
//!Initialization of a PDSS object using an xml tree
|
||||
//!Initialization of a PDSS object using an XML tree
|
||||
/*!
|
||||
* This routine is a driver for the initialization of the object.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ public:
|
|||
void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex,
|
||||
const std::string& inputFile, const std::string& id);
|
||||
|
||||
//! Initialization of a PDSS object using an xml tree
|
||||
//! Initialization of a PDSS object using an XML tree
|
||||
/*!
|
||||
* This routine is a driver for the initialization of the object.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ private:
|
|||
void constructPDSSFile(VPStandardStateTP* vptp_ptr, size_t spindex,
|
||||
const std::string& inputFile, const std::string& id);
|
||||
|
||||
//! Initialization of a PDSS object using an xml tree
|
||||
//! Initialization of a PDSS object using an XML tree
|
||||
/*!
|
||||
* This routine is a driver for the initialization of the object.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ public:
|
|||
void constructPDSSFile(VPStandardStateTP* vptp_ptr, int spindex,
|
||||
const std::string& inputFile, const std::string& id);
|
||||
|
||||
//!Initialization of a PDSS object using an xml tree
|
||||
//!Initialization of a PDSS object using an XML tree
|
||||
/*!
|
||||
* This routine is a driver for the initialization of the
|
||||
* object.
|
||||
|
|
|
|||
|
|
@ -81,10 +81,10 @@ namespace Cantera
|
|||
*
|
||||
* Specify that the input mole, mass, and volume fraction vectors must sum to one on entry to the set state routines.
|
||||
* Non-conforming mole/mass fraction vectors are not thermodynamically consistent.
|
||||
* Moreover, unless we do this, the calculation of jacobians will be altered whenever the treatment of non-conforming mole
|
||||
* Moreover, unless we do this, the calculation of Jacobians will be altered whenever the treatment of non-conforming mole
|
||||
* fractions is changed. Add setState functions corresponding to specifying mole numbers, which is actually what
|
||||
* is being done (well one of the options, there are many) when non-conforming mole fractions are input.
|
||||
* Note, we realize that most numerical jacobian and some analytical jacobians use non-conforming calculations.
|
||||
* Note, we realize that most numerical Jacobian and some analytical Jacobians use non-conforming calculations.
|
||||
* These can easily be changed to the set mole number setState functions.
|
||||
*
|
||||
* @ingroup phases
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @file PhaseCombo_Interaction.h
|
||||
* Header for intermediate ThermoPhase object for phases which
|
||||
* employ the Margules gibbs free energy formulation and eliminates the ideal mixing term.
|
||||
* employ the Margules Gibbs free energy formulation and eliminates the ideal mixing term.
|
||||
* (see \ref thermoprops
|
||||
* and class \link Cantera::PhaseCombo_Interaction PhaseCombo_Interaction\endlink).
|
||||
*/
|
||||
|
|
@ -25,12 +25,12 @@ namespace Cantera
|
|||
*/
|
||||
|
||||
//! PhaseCombo_Interaction is a derived class of GibbsExcessVPSSTP that employs
|
||||
//! the Margules approximation for the excess gibbs free energy while eliminating
|
||||
//! the Margules approximation for the excess Gibbs free energy while eliminating
|
||||
//! the entropy of mixing term.
|
||||
/*!
|
||||
* PhaseCombo_Interaction derives from class GibbsExcessVPSSTP which is derived from VPStandardStateTP,
|
||||
* and overloads the virtual methods defined there with ones that
|
||||
* use expressions appropriate for the Margules Excess gibbs free energy approximation.
|
||||
* use expressions appropriate for the Margules Excess Gibbs free energy approximation.
|
||||
* The reader should refer to the MargulesVPSSTP class for information on that class.
|
||||
* This class in addition adds a term to the activity coefficient that eliminates the
|
||||
* ideal solution mixing term within the chemical potential. This is a very radical thing
|
||||
|
|
@ -78,7 +78,7 @@ namespace Cantera
|
|||
* Each of the interactions are binary interactions involving two of the species in the phase, denoted, <I>Ai</I>
|
||||
* and <I>Bi</I>.
|
||||
* This is the generalization of the Margules formulation for a phase
|
||||
* that has more than 2 species. The second term in the excess gibbs free energy is a negation of the
|
||||
* that has more than 2 species. The second term in the excess Gibbs free energy is a negation of the
|
||||
* ideal solution's mixing term.
|
||||
*
|
||||
* \f[
|
||||
|
|
@ -345,7 +345,7 @@ public:
|
|||
PhaseCombo_Interaction();
|
||||
|
||||
//! Construct and initialize a PhaseCombo_Interaction ThermoPhase object
|
||||
//! directly from an xml input file
|
||||
//! directly from an XML input file
|
||||
/*!
|
||||
* @param inputFile Name of the input file containing the phase XML data
|
||||
* to set up the object
|
||||
|
|
@ -386,7 +386,7 @@ public:
|
|||
|
||||
//! Duplication routine for objects which inherit from ThermoPhase.
|
||||
/*!
|
||||
* This virtual routine can be used to duplicate thermophase objects
|
||||
* This virtual routine can be used to duplicate ThermoPhase objects
|
||||
* inherited from ThermoPhase even if the application only has
|
||||
* a pointer to ThermoPhase to work with.
|
||||
*/
|
||||
|
|
@ -744,51 +744,51 @@ protected:
|
|||
size_t numBinaryInteractions_;
|
||||
|
||||
//! Enthalpy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_HE_b_ij;
|
||||
|
||||
//! Enthalpy term for the ternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_HE_c_ij;
|
||||
|
||||
//! Enthalpy term for the quaternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_HE_d_ij;
|
||||
|
||||
//! Entropy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_SE_b_ij;
|
||||
|
||||
//! Entropy term for the ternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_SE_c_ij;
|
||||
|
||||
//! Entropy term for the quaternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_SE_d_ij;
|
||||
|
||||
//! Enthalpy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VHE_b_ij;
|
||||
|
||||
//! Enthalpy term for the ternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VHE_c_ij;
|
||||
|
||||
//! Enthalpy term for the quaternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VHE_d_ij;
|
||||
|
||||
//! Entropy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VSE_b_ij;
|
||||
|
||||
//! Entropy term for the ternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VSE_c_ij;
|
||||
|
||||
//! Entropy term for the quaternary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable vector_fp m_VSE_d_ij;
|
||||
|
||||
//! vector of species indices representing species A in the interaction
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @file PseudoBinaryVPSSTP.h
|
||||
* Header for intermediate ThermoPhase object for phases which
|
||||
* employ gibbs excess free energy based formulations
|
||||
* employ Gibbs excess free energy based formulations
|
||||
* (see \ref thermoprops
|
||||
* and class \link Cantera::PseudoBinaryVPSSTP PseudoBinaryVPSSTP\endlink).
|
||||
*
|
||||
|
|
@ -92,7 +92,7 @@ public:
|
|||
|
||||
//! Duplication routine for objects which inherit from ThermoPhase.
|
||||
/*!
|
||||
* This virtual routine can be used to duplicate thermophase objects
|
||||
* This virtual routine can be used to duplicate ThermoPhase objects
|
||||
* inherited from ThermoPhase even if the application only has
|
||||
* a pointer to ThermoPhase to work with.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ public:
|
|||
//! Get the nondimensional Gibbs functions for the species
|
||||
//! in their standard states at the current <I>T</I> and <I>P</I> of the solution.
|
||||
/*!
|
||||
* @param grt Output vector of nondimensional standard state gibbs free energies
|
||||
* @param grt Output vector of nondimensional standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getGibbs_RT(doublereal* grt) const;
|
||||
|
|
@ -299,7 +299,7 @@ public:
|
|||
*/
|
||||
virtual void getGibbs_RT_ref(doublereal* grt) const;
|
||||
|
||||
//! Returns the vector of the gibbs function of the reference state at the current temperature
|
||||
//! Returns the vector of the Gibbs function of the reference state at the current temperature
|
||||
//! of the solution and the reference pressure for the species.
|
||||
/*!
|
||||
* units = J/kmol
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @file RedlichKisterVPSSTP.h
|
||||
* Header for intermediate ThermoPhase object for phases which
|
||||
* employ gibbs excess free energy based formulations
|
||||
* employ Gibbs excess free energy based formulations
|
||||
* (see \ref thermoprops
|
||||
* and class \link Cantera::RedlichKisterVPSSTP RedlichKisterVPSSTP\endlink).
|
||||
*
|
||||
|
|
@ -30,11 +30,11 @@ namespace Cantera
|
|||
*/
|
||||
|
||||
//! RedlichKisterVPSSTP is a derived class of GibbsExcessVPSSTP that employs
|
||||
//! the Redlich-Kister approximation for the excess gibbs free energy
|
||||
//! the Redlich-Kister approximation for the excess Gibbs free energy
|
||||
/*!
|
||||
* RedlichKisterVPSSTP derives from class GibbsExcessVPSSTP which is derived
|
||||
* from VPStandardStateTP, and overloads the virtual methods defined there with ones that
|
||||
* use expressions appropriate for the Redlich Kister Excess gibbs free energy approximation.
|
||||
* use expressions appropriate for the Redlich Kister Excess Gibbs free energy approximation.
|
||||
*
|
||||
* The independent unknowns are pressure, temperature, and mass fraction.
|
||||
*
|
||||
|
|
@ -86,7 +86,7 @@ namespace Cantera
|
|||
* G^E_{i} = n X_{Ai} X_{Bi} \sum_m \left( A^{i}_m {\left( X_{Ai} - X_{Bi} \right)}^m \right)
|
||||
* \f]
|
||||
*
|
||||
* and where we can break down the gibbs free energy contributions into enthalpy and entropy contributions
|
||||
* and where we can break down the Gibbs free energy contributions into enthalpy and entropy contributions
|
||||
*
|
||||
* \f[
|
||||
* H^E_i = n X_{Ai} X_{Bi} \sum_m \left( H^{i}_m {\left( X_{Ai} - X_{Bi} \right)}^m \right)
|
||||
|
|
@ -267,7 +267,7 @@ public:
|
|||
RedlichKisterVPSSTP();
|
||||
|
||||
//! Construct and initialize a RedlichKisterVPSSTP ThermoPhase object
|
||||
//! directly from an xml input file
|
||||
//! directly from an XML input file
|
||||
/*!
|
||||
*
|
||||
* @param inputFile Name of the input file containing the phase XML data
|
||||
|
|
@ -309,7 +309,7 @@ public:
|
|||
|
||||
//! Duplication routine for objects which inherit from ThermoPhase.
|
||||
/*!
|
||||
* This virtual routine can be used to duplicate thermophase objects
|
||||
* This virtual routine can be used to duplicate ThermoPhase objects
|
||||
* inherited from ThermoPhase even if the application only has
|
||||
* a pointer to ThermoPhase to work with.
|
||||
*/
|
||||
|
|
@ -664,11 +664,11 @@ protected:
|
|||
std::vector<size_t> m_N_ij;
|
||||
|
||||
//! Enthalpy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable std::vector< vector_fp> m_HE_m_ij;
|
||||
|
||||
//! Entropy term for the binary mole fraction interaction of the
|
||||
//! excess gibbs free energy expression
|
||||
//! excess Gibbs free energy expression
|
||||
mutable std::vector< vector_fp> m_SE_m_ij;
|
||||
|
||||
//! form of the RedlichKister interaction expression
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ public:
|
|||
|
||||
/*!
|
||||
* Returns the vector of the
|
||||
* gibbs function of the reference state at the current temperature
|
||||
* Gibbs function of the reference state at the current temperature
|
||||
* of the solution and the reference pressure for the species.
|
||||
* units = J/kmol
|
||||
*
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class SpeciesThermoInterpType;
|
|||
*
|
||||
* - NasaThermo in file NasaThermo.h
|
||||
* - This is a two zone model, with each zone consisting of a 7
|
||||
* coefficient Nasa Polynomial format.
|
||||
* coefficient NASA Polynomial format.
|
||||
* - ShomateThermo in file ShomateThermo.h
|
||||
* - This is a two zone model, with each zone consisting of a 7
|
||||
* coefficient Shomate Polynomial format.
|
||||
|
|
@ -106,10 +106,10 @@ class SpeciesThermoInterpType;
|
|||
*
|
||||
* - NasaPoly1 in file NasaPoly1.h
|
||||
* - This is a one zone model, consisting of a 7
|
||||
* coefficient Nasa Polynomial format.
|
||||
* coefficient NASA Polynomial format.
|
||||
* - NasaPoly2 in file NasaPoly2.h
|
||||
* - This is a two zone model, with each zone consisting of a 7
|
||||
* coefficient Nasa Polynomial format.
|
||||
* coefficient NASA Polynomial format.
|
||||
* - ShomatePoly in file ShomatePoly.h
|
||||
* - This is a one zone model, consisting of a 7
|
||||
* coefficient Shomate Polynomial format.
|
||||
|
|
@ -124,10 +124,10 @@ class SpeciesThermoInterpType;
|
|||
* the heat capacity is treated as a constant.
|
||||
* - Nasa9Poly1 in file Nasa9Poly1.h
|
||||
* - This is a one zone model, consisting of the 9
|
||||
* coefficient Nasa Polynomial format.
|
||||
* coefficient NASA Polynomial format.
|
||||
* - Nasa9PolyMultiTempRegion in file Nasa9PolyMultiTempRegion.h
|
||||
* - This is a multiple zone model, consisting of the 9
|
||||
* coefficient Nasa Polynomial format in each zone.
|
||||
* coefficient NASA Polynomial format in each zone.
|
||||
*
|
||||
* In particular the NasaThermo SpeciesThermo-derived model has been
|
||||
* optimized for execution speed. It's the main-stay of gas phase computations
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ public:
|
|||
* VPStandardStateTP object.
|
||||
*
|
||||
* This serves to install the species into vpss_ptr, create a PDSS file. We also
|
||||
* read the xml database to extract the constants for these steps.
|
||||
* read the XML database to extract the constants for these steps.
|
||||
*
|
||||
* @param k species number
|
||||
* @param speciesNode Reference to the XML node specifying the species
|
||||
|
|
|
|||
|
|
@ -77,11 +77,11 @@ class VPSSMgr;
|
|||
*
|
||||
* - NasaPoly1 in file NasaPoly1.h
|
||||
* - This is a one zone model, consisting of a 7
|
||||
* coefficient Nasa Polynomial format.
|
||||
* coefficient NASA Polynomial format.
|
||||
* .
|
||||
* - NasaPoly2 in file NasaPoly2.h
|
||||
* - This is a two zone model, with each zone consisting of a 7
|
||||
* coefficient Nasa Polynomial format.
|
||||
* coefficient NASA Polynomial format.
|
||||
* .
|
||||
* - ShomatePoly in file ShomatePoly.h
|
||||
* - This is a one zone model, consisting of a 7
|
||||
|
|
@ -101,11 +101,11 @@ class VPSSMgr;
|
|||
* .
|
||||
* - Nasa9Poly1 in file Nasa9Poly1.h
|
||||
* - This is a one zone model, consisting of the 9
|
||||
* coefficient Nasa Polynomial format.
|
||||
* coefficient NASA Polynomial format.
|
||||
* .
|
||||
* - Nasa9PolyMultiTempRegion in file Nasa9PolyMultiTempRegion.h
|
||||
* - This is a multiple zone model, consisting of the 9
|
||||
* coefficient Nasa Polynomial format in each zone.
|
||||
* coefficient NASA Polynomial format in each zone.
|
||||
* .
|
||||
* - STITbyPDSS in file SpeciesThermoInterpType.h
|
||||
* - This is an object that calculates reference state thermodynamic
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ public:
|
|||
|
||||
/**
|
||||
* For a stoichiometric substance, there is only one species.
|
||||
* This method returns the molar gibbs function in the
|
||||
* This method returns the molar Gibbs function in the
|
||||
* first element of array \c mu.
|
||||
*/
|
||||
virtual void getChemPotentials(doublereal* mu) const;
|
||||
|
|
@ -272,7 +272,7 @@ public:
|
|||
//! state of the species at the current <I>T</I> and <I>P</I> of the solution
|
||||
/*!
|
||||
* Units are Joules/kmol
|
||||
* @param gpure Output vector of standard state gibbs free energies
|
||||
* @param gpure Output vector of standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getPureGibbs(doublereal* gpure) const;
|
||||
|
|
@ -312,20 +312,20 @@ public:
|
|||
*
|
||||
* This function fills in its one entry in hrt[] by calling
|
||||
* the underlying species thermo function for the
|
||||
* dimensionless gibbs free energy, calculated from the
|
||||
* dimensionless Gibbs free energy, calculated from the
|
||||
* dimensionless enthalpy and entropy.
|
||||
*/
|
||||
virtual void getGibbs_RT_ref(doublereal* grt) const;
|
||||
|
||||
/**
|
||||
* Returns the vector of the
|
||||
* gibbs function of the reference state at the current temperature
|
||||
* Gibbs function of the reference state at the current temperature
|
||||
* of the solution and the reference pressure for the species.
|
||||
* units = J/kmol
|
||||
*
|
||||
* This function fills in its one entry in g[] by calling
|
||||
* the underlying species thermo functions for the
|
||||
* gibbs free energy, calculated from enthalpy and the
|
||||
* Gibbs free energy, calculated from enthalpy and the
|
||||
* entropy, and the multiplying by RT.
|
||||
*/
|
||||
virtual void getGibbs_ref(doublereal* g) const;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ namespace Cantera
|
|||
* \f]
|
||||
*
|
||||
* The standard state heat capacity and entropy are independent
|
||||
* of pressure. The standard state gibbs free energy is obtained
|
||||
* of pressure. The standard state Gibbs free energy is obtained
|
||||
* from the enthalpy and entropy functions.
|
||||
*
|
||||
* <b> Specification of Solution Thermodynamic Properties </b>
|
||||
|
|
@ -368,7 +368,7 @@ public:
|
|||
//! Get the nondimensional Gibbs functions for the species
|
||||
//! in their standard states at the current <I>T</I> and <I>P</I> of the solution.
|
||||
/*!
|
||||
* @param grt Output vector of nondimensional standard state gibbs free energies
|
||||
* @param grt Output vector of nondimensional standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getGibbs_RT(doublereal* grt) const;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace Cantera
|
|||
* \f]
|
||||
*
|
||||
* Also, the standard state chemical potentials, entropy, and heat capacities
|
||||
* are independent of pressure. The standard state gibbs free energy is obtained
|
||||
* are independent of pressure. The standard state Gibbs free energy is obtained
|
||||
* from the enthalpy and entropy functions.
|
||||
*
|
||||
* <b> Specification of Solution Thermodynamic Properties </b>
|
||||
|
|
@ -420,7 +420,7 @@ public:
|
|||
//! Get the nondimensional Gibbs functions for the species
|
||||
//! in their standard states at the current <I>T</I> and <I>P</I> of the solution.
|
||||
/*!
|
||||
* @param grt Output vector of nondimensional standard state gibbs free energies
|
||||
* @param grt Output vector of nondimensional standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getGibbs_RT(doublereal* grt) const;
|
||||
|
|
@ -582,7 +582,7 @@ protected:
|
|||
//! Temporary storage for the reference state heat capacities
|
||||
mutable vector_fp m_cp0;
|
||||
|
||||
//! Temporary storage for the reference state gibbs energies
|
||||
//! Temporary storage for the reference state Gibbs energies
|
||||
mutable vector_fp m_mu0;
|
||||
|
||||
//! Temporary work array
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ std::string eosTypeString(int ieos, int length = 100);
|
|||
//! tree.
|
||||
/*!
|
||||
* This routine first looks up the identity of the model for the solution
|
||||
* thermodynamics in the model attribute of the thermo child of the xml phase
|
||||
* thermodynamics in the model attribute of the thermo child of the XML phase
|
||||
* node. Then, it does a string lookup using Cantera's internal ThermoPhase
|
||||
* Factory routines on the model to figure out what ThermoPhase derived class
|
||||
* should be assigned. It creates a new instance of that class, and then calls
|
||||
|
|
@ -163,7 +163,7 @@ ThermoPhase* newPhase(XML_Node& phase);
|
|||
*/
|
||||
ThermoPhase* newPhase(const std::string& infile, std::string id="");
|
||||
|
||||
//! Import a phase information into an empty thermophase object
|
||||
//! Import a phase information into an empty ThermoPhase object
|
||||
/*!
|
||||
* Here we read an XML description of the thermodynamic information
|
||||
* for a phase. At the end of this routine, the phase should
|
||||
|
|
@ -218,7 +218,7 @@ ThermoPhase* newPhase(const std::string& infile, std::string id="");
|
|||
* the species in the phase.
|
||||
* @param th Pointer to the ThermoPhase object which will
|
||||
* handle the thermodynamics for this phase.
|
||||
* We initialize part of the Thermophase object
|
||||
* We initialize part of the ThermoPhase object
|
||||
* here, especially for those objects which are
|
||||
* part of the Cantera Kernel.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -80,9 +80,9 @@ const int cSS_CONVENTION_SLAVE = 2;
|
|||
* dimensionless.
|
||||
*
|
||||
* K_p is the calculation of the equilibrium constant from the
|
||||
* reference state gibbs free energy values. It is by definition
|
||||
* reference state Gibbs free energy values. It is by definition
|
||||
* dimensionless. The pressure dependence is handled entirely
|
||||
* on the rhs of the equilibrium expression.
|
||||
* on the RHS of the equilibrium expression.
|
||||
*
|
||||
* K_c is the equilibrium constant calculated from the
|
||||
* activity concentrations. The dimensions depend on the number
|
||||
|
|
@ -694,7 +694,7 @@ public:
|
|||
//! Get the nondimensional Gibbs functions for the species
|
||||
//! in their standard states at the current <I>T</I> and <I>P</I> of the solution.
|
||||
/*!
|
||||
* @param grt Output vector of nondimensional standard state gibbs free energies
|
||||
* @param grt Output vector of nondimensional standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getGibbs_RT(doublereal* grt) const {
|
||||
|
|
@ -705,7 +705,7 @@ public:
|
|||
//! state of the species at the current <I>T</I> and <I>P</I> of the solution
|
||||
/*!
|
||||
* Units are Joules/kmol
|
||||
* @param gpure Output vector of standard state gibbs free energies
|
||||
* @param gpure Output vector of standard state Gibbs free energies
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getPureGibbs(doublereal* gpure) const {
|
||||
|
|
@ -802,7 +802,7 @@ public:
|
|||
}
|
||||
|
||||
//! Returns the vector of the
|
||||
//! gibbs function of the reference state at the current temperature
|
||||
//! Gibbs function of the reference state at the current temperature
|
||||
//! of the solution and the reference pressure for the species.
|
||||
/*!
|
||||
* units = J/kmol
|
||||
|
|
@ -1648,7 +1648,7 @@ protected:
|
|||
* Occasionally, the need arises to find a safe mole fraction vector to initialize
|
||||
* the object to. This contains such a vector.
|
||||
* The algorithm will pick up the mole fraction vector that is applied from
|
||||
* the state xml file in the input file
|
||||
* the state XML file in the input file
|
||||
*/
|
||||
std::vector<doublereal> xMol_Ref;
|
||||
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ public:
|
|||
}
|
||||
|
||||
/*!
|
||||
* Returns the vector of the gibbs function of the reference state at the
|
||||
* Returns the vector of the Gibbs function of the reference state at the
|
||||
* current temperature of the solution and the reference pressure for the
|
||||
* species. units = J/kmol
|
||||
*
|
||||
|
|
@ -822,7 +822,7 @@ protected:
|
|||
*/
|
||||
mutable vector_fp mPDSS_cp0_R;
|
||||
|
||||
//! species reference gibbs free energies - used by individual PDSS objects
|
||||
//! species reference Gibbs free energies - used by individual PDSS objects
|
||||
/**
|
||||
* Vector containing the species reference Gibbs functions
|
||||
* at T = m_tlast and P = p_ref.
|
||||
|
|
@ -857,7 +857,7 @@ protected:
|
|||
*/
|
||||
mutable vector_fp mPDSS_cpss_R;
|
||||
|
||||
//! species standard state gibbs free energies - used by individual PDSS objects
|
||||
//! species standard state Gibbs free energies - used by individual PDSS objects
|
||||
/**
|
||||
* Vector containing the species standard state Gibbs functions
|
||||
* at T = m_tlast and P = p_ref.
|
||||
|
|
|
|||
|
|
@ -407,7 +407,7 @@ protected:
|
|||
public:
|
||||
/*!
|
||||
* Returns the vector of the
|
||||
* gibbs function of the reference state at the current temperature
|
||||
* Gibbs function of the reference state at the current temperature
|
||||
* of the solution and the reference pressure for the species.
|
||||
* units = J/kmol
|
||||
*
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ public:
|
|||
*/
|
||||
doublereal dfind(doublereal p_red, doublereal tau, doublereal deltaGuess);
|
||||
|
||||
//! Calculate the dimensionless gibbs free energy
|
||||
//! Calculate the dimensionless Gibbs free energy
|
||||
doublereal gibbs_RT() const;
|
||||
|
||||
//! Calculate the dimensionless enthalpy, h/RT
|
||||
|
|
|
|||
|
|
@ -205,21 +205,21 @@ public:
|
|||
//! @name Properties of the Standard State of the Species in the Solution
|
||||
//! @{
|
||||
|
||||
//! Get the gibbs function for the species
|
||||
//! Get the Gibbs function for the species
|
||||
//! standard states at the current T and P of the solution.
|
||||
/*!
|
||||
* @param gss Vector of length m_kk, which on return
|
||||
* will contain the
|
||||
* standard state gibbs function for species <I>k</I>.
|
||||
* standard state Gibbs function for species <I>k</I>.
|
||||
*/
|
||||
virtual void getStandardChemPotentials(doublereal* gss) const;
|
||||
|
||||
//!Get the nondimensional gibbs function for the species
|
||||
//!Get the nondimensional Gibbs function for the species
|
||||
//! standard states at the current T and P of the solution.
|
||||
/*!
|
||||
* @param grt Vector of length m_kk, which on return
|
||||
* will contain the nondimensional
|
||||
* standard state gibbs function for species <I>k</I>
|
||||
* standard state Gibbs function for species <I>k</I>
|
||||
*/
|
||||
virtual void getGibbs_RT(doublereal* grt) const;
|
||||
|
||||
|
|
@ -288,7 +288,7 @@ public:
|
|||
virtual void getGibbs_RT_ref(doublereal* grt) const;
|
||||
|
||||
/*!
|
||||
* Returns the vector of the gibbs function of the reference state at the
|
||||
* Returns the vector of the Gibbs function of the reference state at the
|
||||
* current temperature of the solution and the reference pressure for the
|
||||
* species. units = J/kmol
|
||||
*
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ namespace Cantera
|
|||
* \sum_i \mathbf{j}_i = 0
|
||||
* \f]
|
||||
*
|
||||
* When there are charged species, we replace the rhs with the
|
||||
* When there are charged species, we replace the RHS with the
|
||||
* gradient of the electrochemical potential to obtain the
|
||||
* modified equation
|
||||
*
|
||||
|
|
@ -435,10 +435,10 @@ private:
|
|||
*/
|
||||
DenseMatrix m_wratkj1;
|
||||
|
||||
//! RHS to the stefan-maxwell equation
|
||||
//! RHS to the Stefan-Maxwell equation
|
||||
Array2D m_B;
|
||||
|
||||
//! Matrix for the stefan maxwell equation.
|
||||
//! Matrix for the Stefan-Maxwell equation.
|
||||
DenseMatrix m_A;
|
||||
|
||||
//! Internal storage for the species LJ well depth
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ public:
|
|||
* \f[
|
||||
* x = A T^b \exp( - E / RT )
|
||||
* \f]
|
||||
* where A, b, and E are passed in the xml input file.
|
||||
* where A, b, and E are passed in the XML input file.
|
||||
*
|
||||
* As an example of the input required for LTPspecies_Arrhenius
|
||||
* consider the following XML fragment
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ protected:
|
|||
* \f]
|
||||
* where F is Faraday's constant, RT is the gas constant times the
|
||||
* tempurature, and V is the molar volume (basis is moles of ions) that is
|
||||
* calculated by the thermophase member. X_A and X_B are the mole fractions
|
||||
* calculated by the ThermoPhase member. X_A and X_B are the mole fractions
|
||||
* of the salts composed of cation(1) and cation(2), respectively, that share
|
||||
* a common anion(3). \f$\nu_{+,-}\f$ are the stoichiometric coefficients in
|
||||
* the dissociation reaction of the salts to the ions with charges of
|
||||
|
|
@ -463,7 +463,7 @@ protected:
|
|||
* where the self diffusion coefficients, \f$D_i^*\f$, are temperature and
|
||||
* composition parameterized inputs and the derivative of the activity
|
||||
* coefficient, \f$\frac{\partial \gamma_B}{\partial N_B}\f$, is calculated
|
||||
* by the thermophase member using the excess enthalpy and entropy upon mixing.
|
||||
* by the ThermoPhase member using the excess enthalpy and entropy upon mixing.
|
||||
*
|
||||
* Finally, the deviation of the transferrence numbers from ideality,
|
||||
* \f$\epsilon\f$, is calculated from the mobility ratio of the cations.
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ public:
|
|||
* tracer species at the current temperature and composition of the
|
||||
* species. Therefore, the dilute limit of transport is assumed for the
|
||||
* tracer species. The effective formula may be calculated from the
|
||||
* stefan-maxwell formulation by adding another row for the tracer
|
||||
* Stefan-Maxwell formulation by adding another row for the tracer
|
||||
* species, assigning all D's to be equal to the respective species D's,
|
||||
* and then taking the limit as the tracer species mole fraction goes to
|
||||
* zero. The corresponding flux equation for the tracer species k in
|
||||
|
|
@ -656,14 +656,14 @@ protected:
|
|||
* \nabla ( \ln a_k ) \right]
|
||||
* \f]
|
||||
*
|
||||
* The gradient in the activity coefficient requires the use of thermophase
|
||||
* The gradient in the activity coefficient requires the use of ThermoPhase
|
||||
* getdlnActCoeff that calculates its change based on a change in the state
|
||||
* (i.e. temperature and composition of each species) which was first
|
||||
* implemented in MargulesVPSSTP.cpp (LiquidTransport.h doxygen)
|
||||
*/
|
||||
virtual void update_Grad_lnAC();
|
||||
|
||||
//! Solve the stefan_maxell equations for the diffusive fluxes.
|
||||
//! Solve the Stefan-Maxwell equations for the diffusive fluxes.
|
||||
/*!
|
||||
* The diffusive mass flux of species \e k is computed
|
||||
* using the Stefan-Maxwell equation
|
||||
|
|
@ -687,7 +687,7 @@ protected:
|
|||
* velocities may be specified as relative to a specific species (i.e. a
|
||||
* solvent) all according to the `velocityBasis` input parameter.
|
||||
*
|
||||
* The gradient in the activity coefficient requires the use of thermophase
|
||||
* The gradient in the activity coefficient requires the use of ThermoPhase
|
||||
* getdlnActCoeff that calculates its change based on a change in the state
|
||||
* i.e. temperature and composition of each species.
|
||||
* First implemented in MargulesVPSSTP.cpp.
|
||||
|
|
@ -914,7 +914,7 @@ private:
|
|||
*/
|
||||
LiquidTranInteraction* m_diffMixModel;
|
||||
|
||||
//! Setfan-Maxwell diffusion coefficients
|
||||
//! Stefan-Maxwell diffusion coefficients
|
||||
DenseMatrix m_diff_Dij;
|
||||
|
||||
//! Hydrodynamic radius for each species expressed as an appropriate subclass of LTPspecies
|
||||
|
|
@ -1169,10 +1169,10 @@ private:
|
|||
//! Vector of activity coefficients
|
||||
vector_fp m_actCoeff;
|
||||
|
||||
//! RHS to the stefan-maxwell equation
|
||||
//! RHS to the Stefan-Maxwell equation
|
||||
DenseMatrix m_B;
|
||||
|
||||
//! Matrix for the stefan maxwell equation.
|
||||
//! Matrix for the Stefan-Maxwell equation.
|
||||
DenseMatrix m_A;
|
||||
|
||||
//! Current Temperature -> locally stored
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace Cantera
|
|||
* \sum_i \mathbf{j}_i = 0
|
||||
* \f]
|
||||
*
|
||||
* When there are charged species, we replace the rhs with the
|
||||
* When there are charged species, we replace the RHS with the
|
||||
* gradient of the electrochemical potential to obtain the
|
||||
* modified equation
|
||||
*
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ public:
|
|||
* The self diffusion coefficient is the diffusion coefficient of a tracer
|
||||
* species at the current temperature and composition of the species.
|
||||
* Therefore, the dilute limit of transport is assumed for the tracer
|
||||
* species. The effective formula may be calculated from the stefan-maxwell
|
||||
* species. The effective formula may be calculated from the Stefan-Maxwell
|
||||
* formulation by adding another row for the tracer species, assigning all
|
||||
* D's to be equal to the respective species D's, and then taking the limit
|
||||
* as the tracer species mole fraction goes to zero. The corresponding flux
|
||||
|
|
@ -372,7 +372,7 @@ public:
|
|||
//! Get the Electrical mobilities (m^2/V/s).
|
||||
/*!
|
||||
* This function returns the mobilities. In some formulations
|
||||
* this is equal to the normal mobility multiplied by faraday's constant.
|
||||
* this is equal to the normal mobility multiplied by Faraday's constant.
|
||||
*
|
||||
* Frequently, but not always, the mobility is calculated from the
|
||||
* diffusion coefficient using the Einstein relation
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* @file TransportParams.h
|
||||
* Class that holds the data that is read in from the xml file, and which is used for
|
||||
* Class that holds the data that is read in from the XML file, and which is used for
|
||||
* processing of the transport object
|
||||
* (see \ref tranprops and \link Cantera::TransportParams TransportParams \endlink).
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ def is_local_species(name):
|
|||
return 0
|
||||
|
||||
def dataset(nm):
|
||||
"Set the dataset name. Invoke this to change the name of the xml file."
|
||||
"Set the dataset name. Invoke this to change the name of the XML file."
|
||||
global _name
|
||||
_name = nm
|
||||
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ cdef class Mixture:
|
|||
return self.mix.charge()
|
||||
|
||||
def phase_charge(self, p):
|
||||
"""The charge of phase *p* in Coulumbs."""
|
||||
"""The charge of phase *p* in Coulombs."""
|
||||
return self.mix.phaseCharge(self.phase_index(p))
|
||||
|
||||
def phase_moles(self, p=None):
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ cdef class ThermoPhase(_SolutionBase):
|
|||
* 'gibbs' - a slower but more robust Gibbs minimization solver
|
||||
* 'vcs' - the VCS non-ideal equilibrium solver
|
||||
* "auto" - The element potential solver will be tried first, then
|
||||
if it fails the gibbs solver will be tried.
|
||||
if it fails the Gibbs solver will be tried.
|
||||
:param rtol:
|
||||
the relative error tolerance.
|
||||
:param maxsteps:
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ else:
|
|||
localenv['mak_boost_libs'] = ' '.join('-l%s' % s for s in localenv['boost_libs'])
|
||||
pc_libs += localenv['boost_libs']
|
||||
|
||||
# Handle blas/lapack linkage
|
||||
# Handle BLAS/LAPACK linkage
|
||||
localenv['mak_have_blas_lapack_dir'] = '1' if localenv['blas_lapack_dir'] else '0'
|
||||
|
||||
if localenv['blas_lapack_dir']:
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ protected:
|
|||
std::map<std::string, std::string> options;
|
||||
//! Current value of tmp_dir
|
||||
std::string tmp_dir;
|
||||
//! Current vector of xml file trees that have been previously parsed
|
||||
//! Current vector of XML file trees that have been previously parsed
|
||||
//! The second element of the value is used to store the last-modified time
|
||||
//! for the file, to enable change detection.
|
||||
std::map<std::string, std::pair<XML_Node*, int> > xmlfiles;
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ size_t getFloatArray(const Cantera::XML_Node& node, std::vector<doublereal> & v,
|
|||
vector<Cantera::XML_Node*> ll = node.getChildren(nodeName);
|
||||
if (ll.size() == 0) {
|
||||
throw CanteraError("getFloatArray",
|
||||
"wrong xml element type/name: was expecting "
|
||||
"wrong XML element type/name: was expecting "
|
||||
+ nodeName + "but accessed " + node.name());
|
||||
} else {
|
||||
readNode = ll[0];
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ size_t Cantera::BasisOptimize(int* usedZeroedSpecies, bool doFormRxn,
|
|||
* C will be an nc x nc matrix made up of the formula
|
||||
* vectors for the components. Each component's formula
|
||||
* vector is a column. The rows are the elements.
|
||||
* n rhs's will be solved for. Thus, B is an nc x n
|
||||
* n RHS's will be solved for. Thus, B is an nc x n
|
||||
* matrix.
|
||||
*
|
||||
* BIG PROBLEM 1/21/99:
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ int ChemEquil::equilibrate(thermo_t& s, const char* XYstr,
|
|||
|
||||
size_t mm = m_mm;
|
||||
size_t nvar = mm + 1;
|
||||
DenseMatrix jac(nvar, nvar); // jacobian
|
||||
DenseMatrix jac(nvar, nvar); // Jacobian
|
||||
vector_fp x(nvar, -102.0); // solution vector
|
||||
vector_fp res_trial(nvar, 0.0); // residual
|
||||
|
||||
|
|
@ -585,7 +585,7 @@ int ChemEquil::equilibrate(thermo_t& s, const char* XYstr,
|
|||
* Do a better estimate of the element potentials.
|
||||
* We have found that the current estimate may not be good
|
||||
* enough to avoid drastic numerical issues associated with
|
||||
* the use of a numerically generated jacobian.
|
||||
* the use of a numerically generated Jacobian.
|
||||
*
|
||||
* The Brinkley algorithm assumes a constant T, P system
|
||||
* and uses a linearized analytical Jacobian that turns out
|
||||
|
|
@ -693,7 +693,7 @@ int ChemEquil::equilibrate(thermo_t& s, const char* XYstr,
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
// compute the residual and the jacobian using the current
|
||||
// compute the residual and the Jacobian using the current
|
||||
// solution vector
|
||||
equilResidual(s, x, elMolesGoal, res_trial, xval, yval);
|
||||
f = 0.5*dot(res_trial.begin(), res_trial.end(), res_trial.begin());
|
||||
|
|
|
|||
|
|
@ -785,7 +785,7 @@ int vcs_Cantera_to_vprob(Cantera::MultiPhase* mphase,
|
|||
for (size_t iphase = 0; iphase < totNumPhases; iphase++) {
|
||||
|
||||
/*
|
||||
* Get the thermophase object - assume volume phase
|
||||
* Get the ThermoPhase object - assume volume phase
|
||||
*/
|
||||
Cantera::ThermoPhase* tPhase = &(mphase->phase(iphase));
|
||||
size_t nelem = tPhase->nElements();
|
||||
|
|
@ -1066,7 +1066,7 @@ int vcs_Cantera_to_vprob(Cantera::MultiPhase* mphase,
|
|||
|
||||
VolPhase->setMolesFromVCS(VCS_STATECALC_OLD, VCS_DATA_PTR(vprob->w));
|
||||
/*
|
||||
* Now, calculate a sample naught gibbs free energy calculation
|
||||
* Now, calculate a sample naught Gibbs free energy calculation
|
||||
* at the specified temperature.
|
||||
*/
|
||||
double R = vcsUtil_gasConstant(vprob->m_VCS_UnitsFormat);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ int VCS_SOLVE::vcs_evalSS_TP(int ipr, int ip1, double Temp, double pres)
|
|||
* comes into play in calculating the ideal equation of state
|
||||
* contributions, and other equations of state also. Therefore,
|
||||
* we will emulate the VCS_UNITS_KELVIN case, here by changing
|
||||
* the initial gibbs free energy units to Kelvin before feeding
|
||||
* the initial Gibbs free energy units to Kelvin before feeding
|
||||
* them to the cpc_ts_GStar_calc() routine. Then, we will revert
|
||||
* them back to unitless at the end of this routine.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -815,7 +815,7 @@ void vcs_VolPhase::_updateLnActCoeffJac()
|
|||
void vcs_VolPhase::sendToVCS_LnActCoeffJac(Cantera::Array2D& np_LnACJac_VCS)
|
||||
{
|
||||
/*
|
||||
* update the Ln Act Coeff jacobian entries with respect to the
|
||||
* update the Ln Act Coeff Jacobian entries with respect to the
|
||||
* mole number of species in the phase -> we always assume that
|
||||
* they are out of date.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -514,7 +514,7 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph)
|
|||
minNumberIterations = 1;
|
||||
}
|
||||
|
||||
// We will do a full newton calculation later, but for now, ...
|
||||
// We will do a full Newton calculation later, but for now, ...
|
||||
bool doSuccessiveSubstitution = true;
|
||||
double funcPhaseStability;
|
||||
vector<doublereal> X_est(nsp, 0.0);
|
||||
|
|
|
|||
|
|
@ -1736,7 +1736,7 @@ double VCS_SOLVE::vcs_minor_alt_calc(size_t kspec, size_t irxn, bool* do_delete,
|
|||
}
|
||||
|
||||
/*
|
||||
* get the diagonal of the activity coefficient jacobian
|
||||
* get the diagonal of the activity coefficient Jacobian
|
||||
*/
|
||||
s = m_np_dLnActCoeffdMolNum(kspec,kspec) / (m_tPhaseMoles_old[iph]);
|
||||
/*
|
||||
|
|
@ -2821,7 +2821,7 @@ L_END_LOOP:
|
|||
* coefficients. CX + B = 0
|
||||
* C will be an nc x nc matrix made up of the formula
|
||||
* vectors for the components.
|
||||
* n rhs's will be solved for. Thus, B is an nc x n
|
||||
* n RHS's will be solved for. Thus, B is an nc x n
|
||||
* matrix.
|
||||
*
|
||||
* BIG PROBLEM 1/21/99:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ Kinetics* KineticsFactory::newKinetics(XML_Node& phaseData,
|
|||
vector<ThermoPhase*> th)
|
||||
{
|
||||
/*
|
||||
* Look for a child of the xml element phase called
|
||||
* Look for a child of the XML element phase called
|
||||
* "kinetics". It has an attribute name "model".
|
||||
* Store the value of that attribute in the variable kintype
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -104,8 +104,8 @@ bool getReagents(const XML_Node& rxn, Kinetics& kin, int rp,
|
|||
/*
|
||||
* The id of reactants and products are kept in child elements
|
||||
* of reaction, named "reactants" and "products". We search
|
||||
* the xml tree for these children based on the value of rp,
|
||||
* and store the xml element pointer here.
|
||||
* the XML tree for these children based on the value of rp,
|
||||
* and store the XML element pointer here.
|
||||
*/
|
||||
if (rp == 1) {
|
||||
rptype = "reactants";
|
||||
|
|
@ -196,7 +196,7 @@ bool getReagents(const XML_Node& rxn, Kinetics& kin, int rp,
|
|||
}
|
||||
|
||||
/**
|
||||
* getArrhenius() parses the xml element called Arrhenius.
|
||||
* getArrhenius() parses the XML element called Arrhenius.
|
||||
* The Arrhenius expression is
|
||||
* \f[ k = A T^(b) exp (-E_a / RT). \f]
|
||||
* @deprecated to be removed after Cantera 2.2.
|
||||
|
|
@ -565,7 +565,7 @@ bool installReactionArrays(const XML_Node& p, Kinetics& kin,
|
|||
int itot = 0;
|
||||
/*
|
||||
* Search the children of the phase element for the
|
||||
* xml element named reactionArray. If we can't find it,
|
||||
* XML element named reactionArray. If we can't find it,
|
||||
* then return signaling having not found any reactions.
|
||||
* Apparently, we allow multiple reactionArray elements here
|
||||
* Each one will be processed sequentially, with the
|
||||
|
|
@ -578,17 +578,17 @@ bool installReactionArrays(const XML_Node& p, Kinetics& kin,
|
|||
}
|
||||
for (size_t n = 0; n < rarrays.size(); n++) {
|
||||
/*
|
||||
* Go get a reference to the current xml element,
|
||||
* Go get a reference to the current XML element,
|
||||
* reactionArray. We will process this element now.
|
||||
*/
|
||||
const XML_Node& rxns = *rarrays[n];
|
||||
/*
|
||||
* The reactionArray element has an attribute called,
|
||||
* datasrc. The value of the attribute is the xml
|
||||
* datasrc. The value of the attribute is the XML
|
||||
* element comprising the top of the
|
||||
* tree of reactions for the phase.
|
||||
* Find this datasrc element starting with the root
|
||||
* of the current xml node.
|
||||
* of the current XML node.
|
||||
*/
|
||||
const XML_Node* rdata = get_XML_Node(rxns["datasrc"], &rxns.root());
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -243,13 +243,13 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin,
|
|||
}
|
||||
} else {
|
||||
/* make steady state calc a step of 1 million seconds to
|
||||
prevent singular jacobians for some pathological cases */
|
||||
prevent singular Jacobians for some pathological cases */
|
||||
inv_t = 1.0e-6;
|
||||
}
|
||||
deltaT = 1.0/inv_t;
|
||||
|
||||
/*
|
||||
* Call the routine to numerically evaluation the jacobian
|
||||
* Call the routine to numerically evaluation the Jacobian
|
||||
* and residual for the current iteration.
|
||||
*/
|
||||
resjac_eval(m_Jac, DATA_PTR(m_resid), DATA_PTR(m_CSolnSP),
|
||||
|
|
@ -801,7 +801,7 @@ void solveSP::print_header(int ioflag, int ifunc, doublereal time_scale,
|
|||
printf("\n SOLVESP Called to calculate steady state residual\n");
|
||||
printf(" from a good initial guess\n");
|
||||
} else if (ifunc == SFLUX_JACOBIAN) {
|
||||
printf("\n SOLVESP Called to calculate steady state jacobian\n");
|
||||
printf("\n SOLVESP Called to calculate steady state Jacobian\n");
|
||||
printf(" from a good initial guess\n");
|
||||
} else if (ifunc == SFLUX_TRANSIENT) {
|
||||
printf("\n SOLVESP Called to integrate surface in time\n");
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ void BEulerInt::computeResidWts(GeneralMatrix& jac)
|
|||
* We compute residual weights here, which we define as the L_0 norm
|
||||
* of the Jacobian Matrix, weighted by the solution weights.
|
||||
* This is the proper way to guage the magnitude of residuals. However,
|
||||
* it does need the evaluation of the jacobian, and the implementation
|
||||
* it does need the evaluation of the Jacobian, and the implementation
|
||||
* below is slow, but doesn't take up much memory.
|
||||
*
|
||||
* Here a small weighting indicates that the change in solution is
|
||||
|
|
@ -461,7 +461,7 @@ static void print_lvl1_summary(
|
|||
*
|
||||
* This routine is used in numerical differencing schemes in order
|
||||
* to avoid roundoff errors resulting in creating Jacobian terms.
|
||||
* Note: This is a slow routine. However, jacobian errors may cause
|
||||
* Note: This is a slow routine. However, Jacobian errors may cause
|
||||
* loss of convergence. Therefore, in practice this routine
|
||||
* has proved cost-effective.
|
||||
*/
|
||||
|
|
@ -497,7 +497,7 @@ void BEulerInt::beuler_jac(GeneralMatrix& J, double* const f,
|
|||
|
||||
if (m_jacFormMethod & BEULER_JAC_ANAL) {
|
||||
/********************************************************************
|
||||
* Call the function to get a jacobian.
|
||||
* Call the function to get a Jacobian.
|
||||
*/
|
||||
m_func->evalJacobian(time_curr, delta_t_n, CJ, y, ydot, J, f);
|
||||
m_nJacEval++;
|
||||
|
|
@ -507,7 +507,7 @@ void BEulerInt::beuler_jac(GeneralMatrix& J, double* const f,
|
|||
* Generic algorithm to calculate a numerical Jacobian
|
||||
*/
|
||||
/*
|
||||
* Calculate the current value of the rhs given the
|
||||
* Calculate the current value of the RHS given the
|
||||
* current conditions.
|
||||
*/
|
||||
|
||||
|
|
@ -1030,7 +1030,7 @@ double BEulerInt::step(double t_max)
|
|||
calc_ydot(m_order, &m_y_n[0], &m_ydot_n[0]);
|
||||
|
||||
/*
|
||||
* Calculate CJ, the coefficient for the jacobian corresponding to the
|
||||
* Calculate CJ, the coefficient for the Jacobian corresponding to the
|
||||
* derivative of the residual wrt to the acceleration vector.
|
||||
*/
|
||||
if (m_order < 2) {
|
||||
|
|
@ -1780,7 +1780,7 @@ int BEulerInt::solve_nonlinear_problem(double* const y_comm,
|
|||
num_newt_its);
|
||||
} else {
|
||||
if (loglevel > 1) {
|
||||
printf("\t\t\tSolving system with old jacobian\n");
|
||||
printf("\t\t\tSolving system with old Jacobian\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1794,7 +1794,7 @@ int BEulerInt::solve_nonlinear_problem(double* const y_comm,
|
|||
num_backtracks += i_backtracks;
|
||||
|
||||
/*
|
||||
* Impose the minimum number of newton iterations critera
|
||||
* Impose the minimum number of Newton iterations critera
|
||||
*/
|
||||
if (num_newt_its < m_min_newt_its) {
|
||||
if (m == 1) {
|
||||
|
|
@ -1802,7 +1802,7 @@ int BEulerInt::solve_nonlinear_problem(double* const y_comm,
|
|||
}
|
||||
}
|
||||
/*
|
||||
* Impose max newton iteration
|
||||
* Impose max Newton iteration
|
||||
*/
|
||||
if (num_newt_its > 20) {
|
||||
m = -1;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "CVodeInt.h"
|
||||
using namespace std;
|
||||
|
||||
// cvode includes
|
||||
// CVODE includes
|
||||
#include "../../ext/cvode/include/llnltyps.h"
|
||||
#include "../../ext/cvode/include/llnlmath.h"
|
||||
#include "../../ext/cvode/include/cvode.h"
|
||||
|
|
@ -21,7 +21,7 @@ using namespace std;
|
|||
extern "C" {
|
||||
|
||||
/**
|
||||
* Function called by cvode to evaluate ydot given y. The cvode
|
||||
* Function called by CVODE to evaluate ydot given y. The CVODE
|
||||
* integrator allows passing in a void* pointer to access
|
||||
* external data. This pointer is cast to a pointer to a instance
|
||||
* of class FuncEval. The equations to be integrated should be
|
||||
|
|
@ -39,7 +39,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
/**
|
||||
* Function called by cvode to evaluate the Jacobian matrix.
|
||||
* Function called by CVODE to evaluate the Jacobian matrix.
|
||||
* (temporary)
|
||||
* @ingroup odeGroup
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ public:
|
|||
};
|
||||
|
||||
/**
|
||||
* Wrapper class for 'cvode' integrator from LLNL.
|
||||
* The unmodified cvode code is in directory ext/cvode.
|
||||
* Wrapper class for 'CVODE' integrator from LLNL.
|
||||
* The unmodified CVODE code is in directory ext/cvode.
|
||||
*
|
||||
* @see FuncEval.h. Classes that use CVodeInt:
|
||||
* ImplicitChem, ImplicitSurfChem, Reactor
|
||||
|
|
@ -35,7 +35,7 @@ class CVodeInt : public Integrator
|
|||
{
|
||||
public:
|
||||
/*!
|
||||
* Constructor. Default settings: dense jacobian, no user-supplied
|
||||
* Constructor. Default settings: dense Jacobian, no user-supplied
|
||||
* Jacobian function, Newton iteration.
|
||||
*/
|
||||
CVodeInt();
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public:
|
|||
extern "C" {
|
||||
|
||||
/**
|
||||
* Function called by cvodes to evaluate ydot given y. The cvode
|
||||
* Function called by cvodes to evaluate ydot given y. The CVODE
|
||||
* integrator allows passing in a void* pointer to access
|
||||
* external data. This pointer is cast to a pointer to a instance
|
||||
* of class FuncEval. The equations to be integrated should be
|
||||
|
|
@ -289,7 +289,7 @@ void CVodesIntegrator::initialize(double t0, FuncEval& func)
|
|||
* Specify the method and the iteration type:
|
||||
* Cantera Defaults:
|
||||
* CV_BDF - Use BDF methods
|
||||
* CV_NEWTON - use newton's method
|
||||
* CV_NEWTON - use Newton's method
|
||||
*/
|
||||
m_cvode_mem = CVodeCreate(m_method, m_iter);
|
||||
if (!m_cvode_mem) {
|
||||
|
|
|
|||
|
|
@ -1067,7 +1067,7 @@ int NonlinearSolver::doAffineNewtonSolve(const doublereal* const y_curr, const
|
|||
}
|
||||
|
||||
vector_fp delyH(neq_);
|
||||
// First recalculate the scaled residual. It got wiped out doing the newton solve
|
||||
// First recalculate the scaled residual. It got wiped out doing the Newton solve
|
||||
if (m_rowScaling) {
|
||||
for (size_t n = 0; n < neq_; n++) {
|
||||
delyH[n] = -m_rowScales[n] * m_resid[n];
|
||||
|
|
@ -1405,23 +1405,23 @@ void NonlinearSolver::descentComparison(doublereal time_curr, doublereal* ydot0
|
|||
* HKM These have been shown to exactly match up.
|
||||
* The steepest direction is always largest even when there are variable solution weights
|
||||
*
|
||||
* HKM When a hessian is used with junk on the diagonal, funcDecreaseNewtExp2 is no longer accurate as the
|
||||
* HKM When a Hessian is used with junk on the diagonal, funcDecreaseNewtExp2 is no longer accurate as the
|
||||
* direction gets significantly shorter with increasing condition number. This suggests an algorithm where the
|
||||
* newton step from the Hessian should be increased so as to match funcDecreaseNewtExp2 = funcDecreaseNewt2.
|
||||
* This roughly equals the ratio of the norms of the hessian and newton steps. This increased Newton step can
|
||||
* Newton step from the Hessian should be increased so as to match funcDecreaseNewtExp2 = funcDecreaseNewt2.
|
||||
* This roughly equals the ratio of the norms of the Hessian and Newton steps. This increased Newton step can
|
||||
* then be used with the trust region double dogleg algorithm.
|
||||
*/
|
||||
if ((s_print_DogLeg && m_print_flag >= 3) || (doDogLeg_ && m_print_flag >= 5)) {
|
||||
printf("\t\t descentComparison: initial rate of decrease of func in cauchy dir (expected) = %g\n", funcDecreaseSDExp);
|
||||
printf("\t\t descentComparison: initial rate of decrease of func in cauchy dir = %g\n", funcDecreaseSD);
|
||||
printf("\t\t descentComparison: initial rate of decrease of func in newton dir (expected) = %g\n", funcDecreaseNewtExp2);
|
||||
printf("\t\t descentComparison: initial rate of decrease of func in newton dir = %g\n", funcDecreaseNewt2);
|
||||
printf("\t\t descentComparison: initial rate of decrease of func in Cauchy dir (expected) = %g\n", funcDecreaseSDExp);
|
||||
printf("\t\t descentComparison: initial rate of decrease of func in Cauchy dir = %g\n", funcDecreaseSD);
|
||||
printf("\t\t descentComparison: initial rate of decrease of func in Newton dir (expected) = %g\n", funcDecreaseNewtExp2);
|
||||
printf("\t\t descentComparison: initial rate of decrease of func in Newton dir = %g\n", funcDecreaseNewt2);
|
||||
}
|
||||
if ((s_print_DogLeg && m_print_flag >= 3) || (doDogLeg_ && m_print_flag >= 4)) {
|
||||
printf("\t\t descentComparison: initial rate of decrease of Resid in cauchy dir (expected) = %g\n", ResidDecreaseSDExp_);
|
||||
printf("\t\t descentComparison: initial rate of decrease of Resid in cauchy dir = %g\n", ResidDecreaseSD_);
|
||||
printf("\t\t descentComparison: initial rate of decrease of Resid in newton dir (expected) = %g\n", ResidDecreaseNewtExp_);
|
||||
printf("\t\t descentComparison: initial rate of decrease of Resid in newton dir = %g\n", ResidDecreaseNewt_);
|
||||
printf("\t\t descentComparison: initial rate of decrease of Resid in Cauchy dir (expected) = %g\n", ResidDecreaseSDExp_);
|
||||
printf("\t\t descentComparison: initial rate of decrease of Resid in Cauchy dir = %g\n", ResidDecreaseSD_);
|
||||
printf("\t\t descentComparison: initial rate of decrease of Resid in Newton dir (expected) = %g\n", ResidDecreaseNewtExp_);
|
||||
printf("\t\t descentComparison: initial rate of decrease of Resid in Newton dir = %g\n", ResidDecreaseNewt_);
|
||||
}
|
||||
|
||||
if ((s_print_DogLeg && m_print_flag >= 5) || (doDogLeg_ && m_print_flag >= 5)) {
|
||||
|
|
@ -1459,7 +1459,7 @@ void NonlinearSolver::setupDoubleDogleg()
|
|||
* (grad f)T H (grad f) (grad f)T H-1 (grad f)
|
||||
*/
|
||||
/*
|
||||
* This hasn't worked. so will do it heuristically. One issue is that the newton
|
||||
* This hasn't worked. so will do it heuristically. One issue is that the Newton
|
||||
* direction is not the inverse of the Hessian times the gradient. The Hessian
|
||||
* is the matrix squared. Until I have the inverse of the Hessian from QR factorization
|
||||
* I may not be able to do it this way.
|
||||
|
|
@ -1467,8 +1467,8 @@ void NonlinearSolver::setupDoubleDogleg()
|
|||
|
||||
/*
|
||||
* Heuristic algorithm - Find out where on the Newton line the residual is the same
|
||||
* as the residual at the cauchy point. Then, go halfway to
|
||||
* the newton point and call that Nuu.
|
||||
* as the residual at the Cauchy point. Then, go halfway to
|
||||
* the Newton point and call that Nuu.
|
||||
* Maybe we need to check that the linearized residual is
|
||||
* monotonic along that line. However, we haven't needed to yet.
|
||||
*/
|
||||
|
|
@ -2443,15 +2443,15 @@ int NonlinearSolver::decideStep(const doublereal time_curr, int leg, doublereal
|
|||
// Calculate the initial (R**2 * neq) value for the old function
|
||||
doublereal normResid0_2 = m_normResid_0 * m_normResid_0 * neq_;
|
||||
|
||||
// Calculate the distance to the cauchy point
|
||||
// Calculate the distance to the Cauchy point
|
||||
doublereal cauchyDistanceNorm = solnErrorNorm(DATA_PTR(deltaX_CP_));
|
||||
|
||||
// This is the expected initial rate of decrease in the cauchy direction.
|
||||
// This is the expected initial rate of decrease in the Cauchy direction.
|
||||
// -> This is Eqn. 29 = Rhat dot Jhat dy / || d ||
|
||||
doublereal funcDecreaseSDExp = RJd_norm_ / cauchyDistanceNorm * lambdaStar_;
|
||||
if (funcDecreaseSDExp > 0.0) {
|
||||
if (m_print_flag >= 5) {
|
||||
printf("\t\tdecideStep(): Unexpected condition -> cauchy slope is positive\n");
|
||||
printf("\t\tdecideStep(): Unexpected condition -> Cauchy slope is positive\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2711,7 +2711,7 @@ int NonlinearSolver::solve_nonlinear_problem(int SolnType, doublereal* const y_c
|
|||
}
|
||||
} else {
|
||||
if (m_print_flag > 1) {
|
||||
printf("\t solve_nonlinear_problem(): Solving system with old jacobian\n");
|
||||
printf("\t solve_nonlinear_problem(): Solving system with old Jacobian\n");
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
|
@ -2736,7 +2736,7 @@ int NonlinearSolver::solve_nonlinear_problem(int SolnType, doublereal* const y_c
|
|||
}
|
||||
|
||||
/*
|
||||
* Scale the matrix and the rhs, if they aren't already scaled
|
||||
* Scale the matrix and the RHS, if they aren't already scaled
|
||||
* Figure out and store the residual scaling factors.
|
||||
*/
|
||||
scaleMatrix(jac, DATA_PTR(m_y_n_curr), DATA_PTR(m_ydot_n_curr), time_curr, num_newt_its);
|
||||
|
|
@ -2873,12 +2873,12 @@ int NonlinearSolver::solve_nonlinear_problem(int SolnType, doublereal* const y_c
|
|||
|
||||
|
||||
/*
|
||||
* Impose the minimum number of newton iterations criteria
|
||||
* Impose the minimum number of Newton iterations criteria
|
||||
*/
|
||||
if (num_newt_its < m_min_newt_its) {
|
||||
if (retnDamp > NSOLN_RETN_CONTINUE) {
|
||||
if (m_print_flag > 2) {
|
||||
printf("\t solve_nonlinear_problem(): Damped Newton successful (m=%d) but minimum newton"
|
||||
printf("\t solve_nonlinear_problem(): Damped Newton successful (m=%d) but minimum Newton"
|
||||
"iterations not attained. Resolving ...\n", retnDamp);
|
||||
}
|
||||
retnDamp = NSOLN_RETN_CONTINUE;
|
||||
|
|
@ -2886,12 +2886,12 @@ int NonlinearSolver::solve_nonlinear_problem(int SolnType, doublereal* const y_c
|
|||
}
|
||||
|
||||
/*
|
||||
* Impose max newton iteration
|
||||
* Impose max Newton iteration
|
||||
*/
|
||||
if (num_newt_its > maxNewtIts_) {
|
||||
retnDamp = NSOLN_RETN_MAXIMUMITERATIONSEXCEEDED;
|
||||
if (m_print_flag > 1) {
|
||||
printf("\t solve_nonlinear_problem(): Damped newton unsuccessful (max newts exceeded) sfinal = %g\n",
|
||||
printf("\t solve_nonlinear_problem(): Damped Newton unsuccessful (max newts exceeded) sfinal = %g\n",
|
||||
stepNorm_1);
|
||||
}
|
||||
}
|
||||
|
|
@ -3173,7 +3173,7 @@ void NonlinearSolver::print_solnDelta_norm_contrib(const doublereal* const step_
|
|||
*
|
||||
* This routine is used in numerical differencing schemes in order
|
||||
* to avoid roundoff errors resulting in creating Jacobian terms.
|
||||
* Note: This is a slow routine. However, jacobian errors may cause
|
||||
* Note: This is a slow routine. However, Jacobian errors may cause
|
||||
* loss of convergence. Therefore, in practice this routine has proved cost-effective.
|
||||
*
|
||||
* @param a Value of a
|
||||
|
|
@ -3213,7 +3213,7 @@ int NonlinearSolver::beuler_jac(GeneralMatrix& J, doublereal* const f,
|
|||
J.clearFactorFlag();
|
||||
if (m_jacFormMethod == NSOLN_JAC_ANAL) {
|
||||
/********************************************************************
|
||||
* Call the function to get a jacobian.
|
||||
* Call the function to get a Jacobian.
|
||||
*/
|
||||
info = m_func->evalJacobian(time_curr, delta_t_n, CJ, y, ydot, J, f);
|
||||
m_nJacEval++;
|
||||
|
|
@ -3227,7 +3227,7 @@ int NonlinearSolver::beuler_jac(GeneralMatrix& J, doublereal* const f,
|
|||
* Generic algorithm to calculate a numerical Jacobian
|
||||
*/
|
||||
/*
|
||||
* Calculate the current value of the rhs given the
|
||||
* Calculate the current value of the RHS given the
|
||||
* current conditions.
|
||||
*/
|
||||
|
||||
|
|
@ -3254,7 +3254,7 @@ int NonlinearSolver::beuler_jac(GeneralMatrix& J, doublereal* const f,
|
|||
if (m_print_flag >= 7) {
|
||||
if (retn != 1) {
|
||||
printf("\t\t beuler_jac ERROR! calcDeltaSolnVariables() returned an error flag\n");
|
||||
printf("\t\t We will bail from the nonlinear solver after calculating the jacobian");
|
||||
printf("\t\t We will bail from the nonlinear solver after calculating the Jacobian");
|
||||
}
|
||||
if (neq_ < 20) {
|
||||
printf("\t\tUnk m_ewt y dyVector ResN\n");
|
||||
|
|
@ -3354,7 +3354,7 @@ int NonlinearSolver::beuler_jac(GeneralMatrix& J, doublereal* const f,
|
|||
if (m_print_flag >= 7) {
|
||||
if (retn != 1) {
|
||||
printf("\t\t beuler_jac ERROR! calcDeltaSolnVariables() returned an error flag\n");
|
||||
printf("\t\t We will bail from the nonlinear solver after calculating the jacobian");
|
||||
printf("\t\t We will bail from the nonlinear solver after calculating the Jacobian");
|
||||
}
|
||||
if (neq_ < 20) {
|
||||
printf("\t\tUnk m_ewt y dyVector ResN\n");
|
||||
|
|
@ -3460,7 +3460,7 @@ int NonlinearSolver::beuler_jac(GeneralMatrix& J, doublereal* const f,
|
|||
}
|
||||
}
|
||||
/*
|
||||
* Make a copy of the data. Note, this jacobian copy occurs before any matrix scaling operations.
|
||||
* Make a copy of the data. Note, this Jacobian copy occurs before any matrix scaling operations.
|
||||
* It's the raw matrix producted by this routine.
|
||||
*/
|
||||
*jacCopyPtr_ = J;
|
||||
|
|
|
|||
|
|
@ -185,13 +185,13 @@ int solveProb::solve(int ifunc, doublereal time_scale,
|
|||
}
|
||||
} else {
|
||||
/* make steady state calc a step of 1 million seconds to
|
||||
prevent singular jacobians for some pathological cases */
|
||||
prevent singular Jacobians for some pathological cases */
|
||||
inv_t = 1.0e-6;
|
||||
}
|
||||
deltaT = 1.0/inv_t;
|
||||
|
||||
/*
|
||||
* Call the routine to numerically evaluation the jacobian
|
||||
* Call the routine to numerically evaluation the Jacobian
|
||||
* and residual for the current iteration.
|
||||
*/
|
||||
resjac_eval(m_JacCol, DATA_PTR(m_resid), DATA_PTR(m_CSolnSP),
|
||||
|
|
@ -215,7 +215,7 @@ int solveProb::solve(int ifunc, doublereal time_scale,
|
|||
if (m_ioflag > 1) {
|
||||
printIterationHeader(m_ioflag, damp, inv_t, t_real, iter, do_time);
|
||||
/*
|
||||
* Print out the residual and jacobian
|
||||
* Print out the residual and Jacobian
|
||||
*/
|
||||
printResJac(m_ioflag, m_neq, m_Jac, DATA_PTR(m_resid),
|
||||
DATA_PTR(m_wtResid), resid_norm);
|
||||
|
|
@ -618,7 +618,7 @@ void solveProb::print_header(int ioflag, int ifunc, doublereal time_scale,
|
|||
printf("\n SOLVEPROB Called to calculate steady state residual\n");
|
||||
printf(" from a good initial guess\n");
|
||||
} else if (ifunc == SOLVEPROB_JACOBIAN) {
|
||||
printf("\n SOLVEPROB Called to calculate steady state jacobian\n");
|
||||
printf("\n SOLVEPROB Called to calculate steady state Jacobian\n");
|
||||
printf(" from a good initial guess\n");
|
||||
} else if (ifunc == SOLVEPROB_TRANSIENT) {
|
||||
printf("\n SOLVEPROB Called to integrate surface in time\n");
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue