Subversion Repositories wimsdev

Rev

Rev 13325 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13325 Rev 17747
Line 9... Line 9...
9
#include <string>
9
#include <string>
10
#include <map>
10
#include <map>
11
 
11
 
12
#define VERSION "2.14"
12
#define VERSION "2.14"
13
 
13
 
14
/* Constante d'Avogadro, recommandée par CODATA, 2006 */
-
 
15
#define Avogadro 6.022141e+23
-
 
16
 
14
 
17
/* Charge élémentaire, voir wikipedia, 2007 */
15
/* All data and Exact constants from CODATA 2018
18
#define Electron 1.602176e-19
-
 
19
 
16
 
-
 
17
Eite Tiesinga, Peter J. Mohr, David B. Newell, Barry N. Taylor; 
-
 
18
CODATA Recommended Values of the Fundamental Physical Constants: 2018*. 
-
 
19
Journal of Physical and Chemical Reference Data 1 September 2021; 50 (3): 033105. 
-
 
20
https://doi.org/10.1063/5.0064853
-
 
21
 
-
 
22
*/
-
 
23
 
-
 
24
/* Constante d'Avogadro */
-
 
25
#define Avogadro 6.02214076e+23
-
 
26
 
-
 
27
/* Charge élémentaire */
-
 
28
#define Electron 1.602176634e-19
-
 
29
 
20
/* Constante de Boltzmann, voir Wikipedia, 2007 */
30
/* Constante de Boltzmann */
21
#define Kb 1.3806e-23
31
#define Kb 1.380649e-23
22
 
32
 
23
/* D'où la constante de Faraday */
33
/* D'où la constante de Faraday */
24
#define Faraday (Avogadro * Electron)
34
#define Faraday (Avogadro * Electron)
25
 
35
 
26
/* D'où la constante des Gaz parfaits 8.314 J.K^-1.mol^-1 */
36
/* D'où la constante des Gaz parfaits 
-
 
37
R = 8.31446261815324 J/K.mol */
27
#define R (Kb * Avogadro)
38
#define R (Kb * Avogadro)
28
 
39
 
29
/* Température de référence pour les réactions chimiques, 25°C */
40
/* Température de référence pour les réactions chimiques, 25°C */
30
#define T0 (273.15+25)
41
#define T0 (273.15+25)
31
 
42
 
Line 162... Line 173...
162
  bool printNernst(std::ostream & o, const char * prefix ="");
173
  bool printNernst(std::ostream & o, const char * prefix ="");
163
  bool printNernstWIMS(std::ostream & o, bool wantedlatex);
174
  bool printNernstWIMS(std::ostream & o, bool wantedlatex);
164
  bool iswater()const;
175
  bool iswater()const;
165
  bool iselectron()const;
176
  bool iselectron()const;
166
  fraction  nbelectron()const;
177
  fraction  nbelectron()const;
-
 
178
  /* retire les suffixes _aq */
-
 
179
  void delete_aq();
167
  void debug(int decal = 0)const{
180
  void debug(int decal = 0)const{
168
    for (int i=0; i < decal; i++) std::cout << " ";
181
    for (int i=0; i < decal; i++) std::cout << " ";
169
    std::cout << "Molec : ( " << this << " charge = " << ch 
182
    std::cout << "Molec : ( " << this << " charge = " << ch 
170
	 << " nombre = " << nb << " no = " << no;
183
	 << " nombre = " << nb << " no = " << no;
171
    al->debug(decal+2);
184
    al->debug(decal+2);
Line 197... Line 210...
197
  void printNernst(std::ostream & o);
210
  void printNernst(std::ostream & o);
198
  void printNernstWIMS(std::ostream & o, bool wantedlatex);
211
  void printNernstWIMS(std::ostream & o, bool wantedlatex);
199
  int printableNernst();
212
  int printableNernst();
200
  bool redox()const;
213
  bool redox()const;
201
  fraction  nbelectron()const;
214
  fraction  nbelectron()const;
-
 
215
  /* retire les suffixes _aq */
-
 
216
  void delete_aq();
202
  void debug(int decal = 0)const{
217
  void debug(int decal = 0)const{
203
    for (int i=0; i < decal; i++) std::cout << " ";
218
    for (int i=0; i < decal; i++) std::cout << " ";
204
    std::cout << "Membre : ( " << this;
219
    std::cout << "Membre : ( " << this;
205
    for (unsigned int j=0; j < size(); j++){
220
    for (unsigned int j=0; j < size(); j++){
206
      std::cout << j << " :\n";
221
      std::cout << j << " :\n";
Line 234... Line 249...
234
  void simplifie(bool tri);
249
  void simplifie(bool tri);
235
  void numerote(){gauche->numerote(); droit->numerote();};
250
  void numerote(){gauche->numerote(); droit->numerote();};
236
  void triage(){gauche->triage(); droit->triage();};
251
  void triage(){gauche->triage(); droit->triage();};
237
  /* ajuste le coefficient pour qu'il y ait 1 mol du premier réactif */
252
  /* ajuste le coefficient pour qu'il y ait 1 mol du premier réactif */
238
  void coeff1();
253
  void coeff1();
-
 
254
  /* retire les suffixes _aq */
-
 
255
  void delete_aq();
239
  /* mutiplie par la fraction num/den */
256
  /* mutiplie par la fraction num/den */
240
  void multiply(int num, int den);
257
  void multiply(int num, int den);
241
  fraction nbelectron()const{return gauche->nbelectron()-droit->nbelectron();};
258
  fraction nbelectron()const{return gauche->nbelectron()-droit->nbelectron();};
242
  /* renvoie val ou nbelectron()*Faraday*val */
259
  /* renvoie val ou nbelectron()*Faraday*val */
243
  long double enthalpy() const;
260
  long double enthalpy() const;
244
  void normalise(){numerote(); triage(); coeff1();};
261
  void normalise(){numerote(); triage(); coeff1(); delete_aq();};
245
  void printnorm(std::ostream & o);
262
  void printnorm(std::ostream & o);
246
  void printcount(std::ostream & o) const;
263
  void printcount(std::ostream & o) const;
247
  void printelec(std::ostream & o) const;
264
  void printelec(std::ostream & o) const;
248
  void printspecies(std::ostream & o) const;
265
  void printspecies(std::ostream & o) const;
249
  void printweight(std::ostream & o) const;
266
  void printweight(std::ostream & o) const;