ISLEC  Version 4.2
Macros | Functions
psc_model.c File Reference

Implementation of activity (a) and activity coefficient (r) equations of a revised Pitzer-Simonson-Clegg (PSC) ion interaction model for describing the non-ideality of aqueous solution phase. More...

Go to the source code of this file.

Macros

#define CONSTANT_MW   18.015
 
#define CONSTANT_pi   3.1415926
 
#define CONSTANT_NA   6.02214129E+23
 
#define CONSTANT_k   1.3806448E-16
 
#define CONSTANT_e   4.8024E-10
 
#define CONSTANT_pc   0.322
 
#define CONSTANT_Tc   647.096
 
#define CONSTANT_b1   1.99274064
 
#define CONSTANT_b2   1.09965342
 
#define CONSTANT_b3   -0.510839303
 
#define CONSTANT_b4   -1.75493479
 
#define CONSTANT_b5   -45.5170352
 
#define CONSTANT_b6   -6.74694450E+5
 
#define tao_T   (1.0 - T/CONSTANT_Tc)
 
#define p_T
 
#define CONSTANT_U1   3.4279E+2
 
#define CONSTANT_U2   -5.0866E-3
 
#define CONSTANT_U3   9.4690E-7
 
#define CONSTANT_U4   -2.0525
 
#define CONSTANT_U5   3.1159E+3
 
#define CONSTANT_U6   -1.8289E+2
 
#define CONSTANT_U7   -8.0325E+3
 
#define CONSTANT_U8   4.2142E+6
 
#define CONSTANT_U9   2.1417
 
#define D1000_T   (CONSTANT_U1 * exp (CONSTANT_U2 * T + CONSTANT_U3 * T * T))
 
#define C_T   (CONSTANT_U4 + CONSTANT_U5/(CONSTANT_U6 + T))
 
#define B_T   (CONSTANT_U7 + CONSTANT_U8/T + CONSTANT_U9 * T)
 
#define D_T   (D1000_T + C_T * log ((B_T + P)/(B_T + 1000)))
 
#define dp_T
 
#define aw_T   -(1/(p_T))*dp_T
 
#define dD1000_T   CONSTANT_U1*exp(CONSTANT_U2*T + CONSTANT_U3*T*T)*(CONSTANT_U2 + 2*CONSTANT_U3*T)
 
#define dC_T   -CONSTANT_U5/pow(CONSTANT_U6 + T, 2)
 
#define dB_T   (-CONSTANT_U8/(T * T) + CONSTANT_U9)
 
#define dBP1000_T   ((B_T + 1000)*dB_T - (B_T + P)*dB_T)/pow(B_T + 1000, 2)
 
#define dB1000P_T   ((B_T + P)*dB_T - (B_T + 1000)*dB_T)/pow(B_T + P, 2)
 
#define dD_T   (dD1000_T + dC_T * log ((B_T + P)/(B_T + 1000)) + C_T * (B_T + 1000)/(B_T + P)*dBP1000_T)
 
#define dlnD_T   (1/D_T)*dD_T
 
#define d2D1000_T   CONSTANT_U1*exp(CONSTANT_U2*T + CONSTANT_U3*T*T)*(pow(CONSTANT_U2 + 2*CONSTANT_U3*T, 2) + 2*CONSTANT_U3)
 
#define d2C_T   2*CONSTANT_U5/pow(CONSTANT_U6 + T, 3)
 
#define d2B_T   2*CONSTANT_U8/pow(T, 3)
 
#define d2BP1000_T
 
#define d2D_T
 
#define d2p_T
 
#define ROU   13.0
 

Functions

double psc_r (AQUEOUS_PHASE aq, int index, double *n, double T, double P)
 
double psc_a (AQUEOUS_PHASE aq, int index, double *n, double T, double P)
 

Detailed Description

Implementation of activity (a) and activity coefficient (r) equations of a revised Pitzer-Simonson-Clegg (PSC) ion interaction model for describing the non-ideality of aqueous solution phase.

Author
Dongdong Li ddong.nosp@m._li@.nosp@m.hotma.nosp@m.il.c.nosp@m.om
Date
2018-05-26
Version
4.2.0.1

Definition in file psc_model.c.

Macro Definition Documentation

◆ aw_T

#define aw_T   -(1/(p_T))*dp_T

Definition at line 74 of file psc_model.c.

◆ B_T

#define B_T   (CONSTANT_U7 + CONSTANT_U8/T + CONSTANT_U9 * T)

Definition at line 64 of file psc_model.c.

◆ C_T

#define C_T   (CONSTANT_U4 + CONSTANT_U5/(CONSTANT_U6 + T))

Definition at line 63 of file psc_model.c.

◆ CONSTANT_b1

#define CONSTANT_b1   1.99274064

Definition at line 40 of file psc_model.c.

◆ CONSTANT_b2

#define CONSTANT_b2   1.09965342

Definition at line 41 of file psc_model.c.

◆ CONSTANT_b3

#define CONSTANT_b3   -0.510839303

Definition at line 42 of file psc_model.c.

◆ CONSTANT_b4

#define CONSTANT_b4   -1.75493479

Definition at line 43 of file psc_model.c.

◆ CONSTANT_b5

#define CONSTANT_b5   -45.5170352

Definition at line 44 of file psc_model.c.

◆ CONSTANT_b6

#define CONSTANT_b6   -6.74694450E+5

Definition at line 45 of file psc_model.c.

◆ CONSTANT_e

#define CONSTANT_e   4.8024E-10

Definition at line 36 of file psc_model.c.

◆ CONSTANT_k

#define CONSTANT_k   1.3806448E-16

Definition at line 35 of file psc_model.c.

◆ CONSTANT_MW

#define CONSTANT_MW   18.015

Definition at line 32 of file psc_model.c.

◆ CONSTANT_NA

#define CONSTANT_NA   6.02214129E+23

Definition at line 34 of file psc_model.c.

◆ CONSTANT_pc

#define CONSTANT_pc   0.322

Definition at line 37 of file psc_model.c.

◆ CONSTANT_pi

#define CONSTANT_pi   3.1415926

Definition at line 33 of file psc_model.c.

◆ CONSTANT_Tc

#define CONSTANT_Tc   647.096

Definition at line 38 of file psc_model.c.

◆ CONSTANT_U1

#define CONSTANT_U1   3.4279E+2

Definition at line 52 of file psc_model.c.

◆ CONSTANT_U2

#define CONSTANT_U2   -5.0866E-3

Definition at line 53 of file psc_model.c.

◆ CONSTANT_U3

#define CONSTANT_U3   9.4690E-7

Definition at line 54 of file psc_model.c.

◆ CONSTANT_U4

#define CONSTANT_U4   -2.0525

Definition at line 55 of file psc_model.c.

◆ CONSTANT_U5

#define CONSTANT_U5   3.1159E+3

Definition at line 56 of file psc_model.c.

◆ CONSTANT_U6

#define CONSTANT_U6   -1.8289E+2

Definition at line 57 of file psc_model.c.

◆ CONSTANT_U7

#define CONSTANT_U7   -8.0325E+3

Definition at line 58 of file psc_model.c.

◆ CONSTANT_U8

#define CONSTANT_U8   4.2142E+6

Definition at line 59 of file psc_model.c.

◆ CONSTANT_U9

#define CONSTANT_U9   2.1417

Definition at line 60 of file psc_model.c.

◆ D1000_T

#define D1000_T   (CONSTANT_U1 * exp (CONSTANT_U2 * T + CONSTANT_U3 * T * T))

Definition at line 62 of file psc_model.c.

◆ d2B_T

#define d2B_T   2*CONSTANT_U8/pow(T, 3)

Definition at line 84 of file psc_model.c.

◆ d2BP1000_T

#define d2BP1000_T
Value:
(((B_T + 1000) * d2B_T - d2B_T * (B_T + P)) * (B_T + 1000) * (B_T + 1000) \
- 2 * (B_T + 1000) * dB_T * \
((B_T + 1000) * dB_T - (B_T + P) * dB_T))/pow(B_T + 1000, 4)
#define B_T
Definition: psc_model.c:64
#define d2B_T
Definition: psc_model.c:84
#define dB_T
Definition: psc_model.c:77

Definition at line 85 of file psc_model.c.

◆ d2C_T

#define d2C_T   2*CONSTANT_U5/pow(CONSTANT_U6 + T, 3)

Definition at line 83 of file psc_model.c.

◆ d2D1000_T

#define d2D1000_T   CONSTANT_U1*exp(CONSTANT_U2*T + CONSTANT_U3*T*T)*(pow(CONSTANT_U2 + 2*CONSTANT_U3*T, 2) + 2*CONSTANT_U3)

Definition at line 82 of file psc_model.c.

◆ d2D_T

#define d2D_T
Value:
(d2D1000_T + d2C_T * log ((B_T + P)/(B_T + 1000)) \
+ dC_T*(B_T+1000)/(B_T+P)*dBP1000_T + (dC_T * (B_T + 1000)/(B_T + P) \
+ C_T * dB1000P_T) * dBP1000_T + C_T * (B_T+1000)/(B_T + P) * d2BP1000_T)
#define C_T
Definition: psc_model.c:63
#define dB1000P_T
Definition: psc_model.c:79
#define d2BP1000_T
Definition: psc_model.c:85
#define dBP1000_T
Definition: psc_model.c:78
#define B_T
Definition: psc_model.c:64
#define d2C_T
Definition: psc_model.c:83
#define d2D1000_T
Definition: psc_model.c:82
#define dC_T
Definition: psc_model.c:76

Definition at line 88 of file psc_model.c.

◆ d2p_T

#define d2p_T
Value:
(CONSTANT_pc/(CONSTANT_Tc * CONSTANT_Tc)) * ((-2.0*CONSTANT_b1/9.0)* pow (tao_T, -5.0/3.0) + \
(-2.0*CONSTANT_b2/9.0)* pow (tao_T, -4.0/3.0) + \
(10.0*CONSTANT_b3/9.0)* pow (tao_T, -1.0/3.0) + \
(208.0*CONSTANT_b4/9.0)* pow (tao_T, 10.0/3.0) + \
(1720.0*CONSTANT_b5/9.0)* pow (tao_T, 37.0/3.0) + \
(11770.0*CONSTANT_b6/9.0)* pow (tao_T, 104.0/3.0))
#define CONSTANT_b5
Definition: psc_model.c:44
#define CONSTANT_b2
Definition: psc_model.c:41
#define CONSTANT_b6
Definition: psc_model.c:45
#define tao_T
Definition: psc_model.c:47
#define CONSTANT_b3
Definition: psc_model.c:42
#define CONSTANT_pc
Definition: psc_model.c:37
#define CONSTANT_b4
Definition: psc_model.c:43
#define CONSTANT_b1
Definition: psc_model.c:40
#define CONSTANT_Tc
Definition: psc_model.c:38

Definition at line 91 of file psc_model.c.

◆ D_T

#define D_T   (D1000_T + C_T * log ((B_T + P)/(B_T + 1000)))

Definition at line 65 of file psc_model.c.

◆ dB1000P_T

#define dB1000P_T   ((B_T + P)*dB_T - (B_T + 1000)*dB_T)/pow(B_T + P, 2)

Definition at line 79 of file psc_model.c.

◆ dB_T

#define dB_T   (-CONSTANT_U8/(T * T) + CONSTANT_U9)

Definition at line 77 of file psc_model.c.

◆ dBP1000_T

#define dBP1000_T   ((B_T + 1000)*dB_T - (B_T + P)*dB_T)/pow(B_T + 1000, 2)

Definition at line 78 of file psc_model.c.

◆ dC_T

#define dC_T   -CONSTANT_U5/pow(CONSTANT_U6 + T, 2)

Definition at line 76 of file psc_model.c.

◆ dD1000_T

#define dD1000_T   CONSTANT_U1*exp(CONSTANT_U2*T + CONSTANT_U3*T*T)*(CONSTANT_U2 + 2*CONSTANT_U3*T)

Definition at line 75 of file psc_model.c.

◆ dD_T

#define dD_T   (dD1000_T + dC_T * log ((B_T + P)/(B_T + 1000)) + C_T * (B_T + 1000)/(B_T + P)*dBP1000_T)

Definition at line 80 of file psc_model.c.

◆ dlnD_T

#define dlnD_T   (1/D_T)*dD_T

Definition at line 81 of file psc_model.c.

◆ dp_T

#define dp_T
Value:
-(CONSTANT_pc/CONSTANT_Tc)*(CONSTANT_b1/3.0 * pow (tao_T, -2.0/3.0) \
+ 2.0 * CONSTANT_b2/3.0 * pow (tao_T, -1.0/3.0) \
+ 5.0 * CONSTANT_b3/3.0 * pow (tao_T, 2.0/3.0) \
+ 16.0 * CONSTANT_b4/3.0 * pow (tao_T, 13/3.0) \
+ 43.0 * CONSTANT_b5/3.0 * pow (tao_T, 40.0/3.0) \
+ 110.0 * CONSTANT_b6/3.0 * pow (tao_T, 107/3.0))
#define CONSTANT_b5
Definition: psc_model.c:44
#define CONSTANT_b2
Definition: psc_model.c:41
#define CONSTANT_b6
Definition: psc_model.c:45
#define tao_T
Definition: psc_model.c:47
#define CONSTANT_b3
Definition: psc_model.c:42
#define CONSTANT_pc
Definition: psc_model.c:37
#define CONSTANT_b4
Definition: psc_model.c:43
#define CONSTANT_b1
Definition: psc_model.c:40
#define CONSTANT_Tc
Definition: psc_model.c:38

Definition at line 67 of file psc_model.c.

◆ p_T

#define p_T
Value:
(CONSTANT_pc)*(1 + CONSTANT_b1 * pow (tao_T, 1.0/3.0) + CONSTANT_b2 * pow (tao_T, 2.0/3.0) \
+ CONSTANT_b3 * pow (tao_T, 5.0/3.0) + CONSTANT_b4 * pow (tao_T, 16.0/3.0) \
+ CONSTANT_b5 * pow (tao_T, 43.0/3.0) + CONSTANT_b6 * pow (tao_T, 110.0/3.0))
#define CONSTANT_b5
Definition: psc_model.c:44
#define CONSTANT_b2
Definition: psc_model.c:41
#define CONSTANT_b6
Definition: psc_model.c:45
#define tao_T
Definition: psc_model.c:47
#define CONSTANT_b3
Definition: psc_model.c:42
#define CONSTANT_pc
Definition: psc_model.c:37
#define CONSTANT_b4
Definition: psc_model.c:43
#define CONSTANT_b1
Definition: psc_model.c:40

Definition at line 48 of file psc_model.c.

◆ ROU

#define ROU   13.0

Definition at line 98 of file psc_model.c.

◆ tao_T

#define tao_T   (1.0 - T/CONSTANT_Tc)

Definition at line 47 of file psc_model.c.

Function Documentation

◆ psc_a()

double psc_a ( AQUEOUS_PHASE  aq,
int  index,
double *  n,
double  T,
double  P 
)

Definition at line 3496 of file psc_model.c.

◆ psc_r()

double psc_r ( AQUEOUS_PHASE  aq,
int  index,
double *  n,
double  T,
double  P 
)

Definition at line 3483 of file psc_model.c.