User talk:Sidharth: Difference between revisions

From ASCEND
Jump to navigation Jump to search
Sidharth (talk | contribs)
No edit summary
Sidharth (talk | contribs)
No edit summary
Line 55: Line 55:
|-
|-
|Enthalpy, h
|Enthalpy, h
|helmholtz_dgdT_rho()        --  <math>\frac{\partial g}{\partial T}\bigg|_{\rho}</math> 
|  
|helmholtz_dgdrho_T()        --  <math>\frac{\partial g}{\partial \rho}\bigg|_{T}</math> 
|  
|helmholtz_d2gdrho2_T()       --  <math>\frac{\partial^2 g}{\partial \rho^2}\bigg|_{T}</math>  
|helmholtz_d2hdrho2_T()     --  <math>\frac{\partial^2 h}{\partial \rho^2}\bigg|_{T}</math>  
|helmholtz_d2gdT2_rho()       --  <math>\frac{\partial^2 g}{\partial T^2}\bigg|_{\rho}</math>  
|helmholtz_d2hdT2_rho()     --  <math>\frac{\partial^2 h}{\partial T ^2}\bigg|_{\rho}</math>  
|helmholtz_d2gdrhodT()       --  <math>\frac{\partial^2 g}{\partial (T \rho)}</math>
|helmholtz_d2hdrhodT()     --  <math>\frac{\partial^2 h}{\partial (T \rho)} </math>  
|-
|-
|Internal Energy, u
|Internal Energy, u
Line 83: Line 83:
|}
|}


Partial second derivatives of Pressure p
#helmholtz_d2pdT2_rho()    --  <math>\frac{\partial^2 p}{\partial T ^2}\bigg|_{\rho}</math>
#helmholtz_d2pdrhodT()      --  <math>\frac{\partial^2 p}{\partial (T \rho)} </math>





Revision as of 18:59, 16 June 2015

FPROPS uses function pointers from the underlying correlation (helmholtz or Pengrob) to calculate fundamental quantities with Temperature and rho as the input. Following are those functions of fprops :-

  1. fprops_p
  2. fprops_u
  3. fprops_h
  4. fprops_s
  5. fprops_a
  6. fprops_g
  7. fprops_P
  8. fprops_dpdrho_T
  9. fprops_alphap
  10. fprops_betaP
  11. fprops_cp
  12. fprops_cv
  13. fprops_w


Both the underlying correlations provide these 13 functions calculated from first principles, with T and <math>\rho</math> as inputs. So the TTSE implementation for a specific liquid and a specific correlation (H or P) should eventually generate tables for each of the above 13 entries. For the saturation function fprops_sat(), takes only 1 input (temperature) and returns saturated liquid density, saturated vapour density and the saturation pressure. This function involves solving equations iteratively and tabulation should speed up calculation on saturation curve.

To begin with we can tabulate the following functions:

  1. helmholtz_p
  2. helmholtz_s
  3. helmholtz_u
  4. helmholtz_g
  5. helmholtz_h

In order to use look up tables for TTSE method inside these routines we need to complete the set of all partial derivatives we need :-

For each of the above variable X (where X is either of P,s,u,g and h) we need <math> \frac{\partial X}{\partial T}\bigg|_{\rho} ,

\frac{\partial^2 X}{\partial T^2}\bigg|_{\rho} ,
   \frac{\partial X}{\partial \rho}\bigg|_{T} , 
\frac{\partial^2 X}{\partial \rho^2}\bigg|_{T}</math>   and <math>
  \frac{\partial^2 X}{\partial \rho \partial T} </math>

Many of the partial derivatives are already listed in helmholtz.c. Specifically the new ones we need to implement are:


Variable Partial derivative wrt T Partial derivative wrt <math>\rho</math> Partial second derivative wrt <math>\rho</math> Partial second derivative wrt <math>T</math> Partial mixed second derivative wrt <math>\rho and T</math>
Pressure, P helmholtz_d2pdT2_rho() -- <math>\frac{\partial^2 p}{\partial (T^2)} </math> helmholtz_d2pdrhodT() -- <math>\frac{\partial^2 p}{\partial (T \rho)} </math>
Enthalpy, h _{T}</math> _{\rho}</math> helmholtz_d2hdrhodT() -- <math>\frac{\partial^2 h}{\partial (T \rho)} </math>
Internal Energy, u _{\rho}</math> _{T}</math> _{T}</math> _{\rho}</math> helmholtz_d2gdrhodT() -- <math>\frac{\partial^2 g}{\partial (T \rho)}</math>
Entropy, s _{\rho}</math> _{T}</math> _{T}</math> _{\rho}</math> helmholtz_d2gdrhodT() -- <math>\frac{\partial^2 g}{\partial (T \rho)}</math>
Gibbs Free Energy, g _{\rho}</math> _{T}</math> _{T}</math> _{\rho}</math> helmholtz_d2gdrhodT() -- <math>\frac{\partial^2 g}{\partial (T \rho)}</math>



Partial second derivatives of enthalpy h

  1. helmholtz_d2hdrho2_T() -- <math>\frac{\partial^2 h}{\partial \rho^2}\bigg|_{T}</math>
  2. helmholtz_d2hdT2_rho() -- <math>\frac{\partial^2 h}{\partial T ^2}\bigg|_{\rho}</math>
  3. helmholtz_d2hdrhodT() -- <math>\frac{\partial^2 h}{\partial (T \rho)} </math>


Partial second derivatives of internal energy u

  1. helmholtz_d2udrho2_T() -- <math>\frac{\partial^2 u}{\partial \rho^2}\bigg|_{T}</math>
  2. helmholtz_d2udT2_rho() -- <math>\frac{\partial^2 u}{\partial T^2}\bigg|_{\rho }</math>
  3. helmholtz_d2udrhodT() -- <math>\frac{\partial^2 u}{\partial (T \rho)}</math>


Partial first and second derivatives of entropy s

  1. helmholtz_dsdT_rho() -- <math>\frac{\partial s}{\partial T}\bigg|_{\rho}</math>
  2. helmholtz_dsdrho_T() -- <math>\frac{\partial s}{\partial \rho}\bigg|_{T}</math>
  3. helmholtz_d2sdrho2_T() -- <math>\frac{\partial^2 s}{\partial \rho^2}\bigg|_{T}</math>
  4. helmholtz_d2sdT2_rho() -- <math>\frac{\partial^2 s}{\partial T^2}\bigg|_{\rho}</math>
  5. helmholtz_d2sdrhodT() -- <math>\frac{\partial^2 s}{\partial (T \rho)}</math>


Partial first and second derivatives of gibbs energy g

  1. helmholtz_dgdT_rho() -- <math>\frac{\partial g}{\partial T}\bigg|_{\rho}</math>
  2. helmholtz_dgdrho_T() -- <math>\frac{\partial g}{\partial \rho}\bigg|_{T}</math>
  3. helmholtz_d2gdrho2_T() -- <math>\frac{\partial^2 g}{\partial \rho^2}\bigg|_{T}</math>
  4. helmholtz_d2gdT2_rho() -- <math>\frac{\partial^2 g}{\partial T^2}\bigg|_{\rho}</math>
  5. helmholtz_d2gdrhodT() -- <math>\frac{\partial^2 g}{\partial (T \rho)}</math>



To evaluate these drivatives we need the partial derivatives of the residual and the ideal part of helmholtz function. So the new functions needed in helmholtz.c and cp0.c

Third partial derivative of ideal part of helmholtz (all other partial derivatives invloving delta are zero)

  • ideal_phi_tautautau()

Third derivative of helmholtz residual function, with respect to delta once and tau twice

  • helm_resid_deltautau()

Third derivative of helmholtz residual function, with respect to delta twice and tau once

  • helm_resid_deldeltau()