File: N:\mfix\model\calc_h.f

1     !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
2     !                                                                      C
3     !  Function name: CALC_H                                               C
4     !  Purpose: Calculate specific enthalpy of species N in phase M        C
5     !                                                                      C
6     !  Author: M. Syamlal                                Date: 27-DEC-2007 C
7     !                                                                      C
8     !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
9           DOUBLE PRECISION FUNCTION CALC_H(refT, M, NN)
10     
11     ! Modules
12     !---------------------------------------------------------------------//
13           USE physprop, only: mw_g, mw_s, HfrefoR
14           USE constant, only: RGAS => GAS_CONST_cal
15           USE read_thermochemical, only: calc_ICpoR
16           IMPLICIT NONE
17     
18     ! Dummy arguments
19     !---------------------------------------------------------------------//
20     ! cell, phase and species indices
21           DOUBLE PRECISION, INTENT(IN) :: refT   ! Temperature
22           INTEGER, INTENT(IN) :: M ! Phase index
23           INTEGER, INTENT(IN) :: NN ! Species index
24     
25     ! Local variables
26     !---------------------------------------------------------------------//
27           DOUBLE PRECISION :: ICpoR
28           DOUBLE PRECISION :: lMW
29           INTEGER :: IER
30     !---------------------------------------------------------------------//
31     
32           IER = 0
33     
34           if(M == 0)then
35              lMW = MW_g(NN)
36           else
37              lMW = MW_s(M,NN)
38           endif
39     
40     ! Integrate the specific heat from zero to refT
41           ICpoR = calc_ICpoR(refT, M, NN, IER)
42     
43     ! Evaluate the enthalpy of species N at refT
44           CALC_H = (HfrefoR(M,NN)  + ICpoR) * (RGAS / lMW)
45     
46           RETURN
47           END FUNCTION CALC_H
48