Diff of /trunk/models/johnpye/fprops/helmholtz.c

revision 2232 by jpye, Wed Jul 28 09:02:51 2010 UTC revision 2233 by jpye, Wed Jul 28 09:09:11 2010 UTC
# Line 605  static double ipow(double x, int n){ Line 605  static double ipow(double x, int n){
605
606  #define DEFINE_D2DELDDELTA2 \  #define DEFINE_D2DELDDELTA2 \
607          double powd12bm1 = pow(d12,0.5/ct->beta-1.); \          double powd12bm1 = pow(d12,0.5/ct->beta-1.); \
608          double d2DELddel2 = 1./d1*dDELddelta + d12*( \          double d2DELddelta2 = 1./d1*dDELddelta + d12*( \
609              4.*ct->B*ct->a*(ct->a-1.)*pow(d12,ct->a-2.) \              4.*ct->B*ct->a*(ct->a-1.)*pow(d12,ct->a-2.) \
610              + 2.*SQ(ct->A)*SQ(1./ct->beta)*SQ(powd12bm1) \              + 2.*SQ(ct->A)*SQ(1./ct->beta)*SQ(powd12bm1) \
611              + ct->A*theta*4./ct->beta*(0.5/ct->beta-1.)*powd12bm1/d12 \              + ct->A*theta*4./ct->beta*(0.5/ct->beta-1.)*powd12bm1/d12 \
612          )          )
613
614  #define DEFINE_D2DELBDDELTA2 \  #define DEFINE_D2DELBDDELTA2 \
615          double d2DELbddelta2 = ct->b * ( (DELB/DELTA)*d2DELddel2 + (ct->b-1.)*(DELB/SQ(DELTA)*SQ(dDELddelta)))          double d2DELbddelta2 = ct->b * ( (DELB/DELTA)*d2DELddelta2 + (ct->b-1.)*(DELB/SQ(DELTA)*SQ(dDELddelta)))
616
617  #define DEFINE_D2PSIDDELTA2 \  #define DEFINE_D2PSIDDELTA2 \
618          double d2PSIddelta2 = (2.*ct->C*d12 - 1.)*2.*ct->C * PSI          double d2PSIddelta2 = (2.*ct->C*d12 - 1.)*2.*ct->C * PSI
# Line 621  static double ipow(double x, int n){ Line 621  static double ipow(double x, int n){
621      double d3PSIddelta3 = -4. * d1 * SQ(ct->C) * (2.*d12*ct->C - 3.) * PSI      double d3PSIddelta3 = -4. * d1 * SQ(ct->C) * (2.*d12*ct->C - 3.) * PSI
622
623  #define DEFINE_D3DELDDELTA3 \  #define DEFINE_D3DELDDELTA3 \
624      double d3DELddelta3 = 0/*UNKNOWN*/      double d3DELddelta3 = 1./(d1*d12*ct->beta*SQ(ct->beta)) * (\
625            4*ct->B*ct->a*(1.+ct->a*(2*ct->a-3))*SQ(ct->beta)*pow(d12,ct->a)\
626            + ct->A * (1.+ct->beta*(2*ct->beta-3))*pow(d12,0.5/ct->beta)\
627        )
628
629  #define DEFINE_D3DELBDDELTA3 \  #define DEFINE_D3DELBDDELTA3 \
630      double d3DELbddelta3 = b / (DELTA*SQ(DELTA)) * ( \      double d3DELbddelta3 = ct->b / (DELTA*SQ(DELTA)) * ( \
631          (2+b*(b-3))*dDELddelta*SQ(dDELddelta)*DELB \          (2+ct->b*(ct->b-3))*dDELddelta*SQ(dDELddelta)*DELB \
632          + DELB*SQ(DELTA)*d3DELddelta3 \          + DELB*SQ(DELTA)*d3DELddelta3 \
633          + 3*(b-1) * DELB * DELTA * dDELddelta * d2DELddelta2 \          + 3*(ct->b-1) * DELB * DELTA * dDELddelta * d2DELddelta2 \
634      )      )
635
636  /**  /**

Legend:
 Removed from v.2232 changed lines Added in v.2233