/[ascend]/trunk/models/johnpye/iapws95.a4c
ViewVC logotype

Diff of /trunk/models/johnpye/iapws95.a4c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 95 by johnpye, Wed Dec 7 16:03:44 2005 UTC revision 96 by johnpye, Thu Dec 8 17:22:38 2005 UTC
# Line 228  MODEL steam_state; Line 228  MODEL steam_state;
228    
229      phi0 IS_A factor;      phi0 IS_A factor;
230      phi0_expr: phi0 =      phi0_expr: phi0 =
231          SUM[ n0[i]*log(1-exp(-tau*gamma0[i])) | i IN [range_01] ]          SUM[ n0[i]*ln(1-exp(-tau*gamma0[i])) | i IN [range_01] ]
232          + log(delta) + n0[1] + n0[2]*tau + n0[3]*log(tau);          + ln(delta) + n0[1] + n0[2]*tau + n0[3]*ln(tau);
233    
234      phi0delta IS_A factor;      phi0delta IS_A factor;
235      phi0delta_expr: phi0delta = 1.0/delta;      phi0delta_expr: phi0delta = 1.0/delta;
# Line 249  MODEL steam_state; Line 249  MODEL steam_state;
249    
250      phi0tautau IS_A factor;      phi0tautau IS_A factor;
251      phi0tautau_expr: phi0tautau      phi0tautau_expr: phi0tautau
252          = -n0[3]/(tau*tau)          = -n0[3] / tau^2
253          - SUM [ n0[i] * gamma0[i]^2 * exp(-tau*gamma0[i]) / ( 1 - exp(-tau*gamma0[i]) )^2 | i IN range_01 ];          - SUM [ n0[i] * gamma0[i]^2 * exp(-gamma0[i] * tau) / ( 1 - exp(-gamma0[i] * tau) )^2 | i IN range_01 ];
254    
255      (*----------- 'REAL' PARTS -- CLOSE YOUR EYES -----------*)      (*----------- 'REAL' PARTS -- CLOSE YOUR EYES -----------*)
256    
# Line 305  MODEL steam_state; Line 305  MODEL steam_state;
305                  A[i]*theta[i]*4/beta_r4[i]*(1/(2*beta_r4[i]) - 1)*                  A[i]*theta[i]*4/beta_r4[i]*(1/(2*beta_r4[i]) - 1)*
306                  (d1^2)^(1/(2*beta_r4[i]) - 2);                  (d1^2)^(1/(2*beta_r4[i]) - 2);
307            
308          (*d2DELTAbi_ddelta2_expr:*) d2DELTAbi_ddelta2[i] =b[i]*(DELTA[i]^(b[i]-1) *          (*d2DELTAbi_ddelta2_expr:*) d2DELTAbi_ddelta2[i] =b[i] * (
309                  d2DELTA_ddelta2[i] + (b[i]-1)*DELTA[i]^(b[i]-2)*                  DELTA[i]^(b[i]-1) *d2DELTA_ddelta2[i]
310                  dDELTA_ddelta[i]^2);                   + (b[i]-1) * DELTA[i]^(b[i]-2) * dDELTA_ddelta[i]^2 );
311                    
312          (*d2DELTAbi_dtau2_expr:*) d2DELTAbi_dtau2[i] = 2*b[i] * DELTA[i]^(b[i]-1) +          (*d2DELTAbi_dtau2_expr:*) d2DELTAbi_dtau2[i] = 2 * b[i] * DELTA[i]^(b[i]-1) +
313                  4*theta[i]^2 * b[i]*(b[i]-1) * DELTA[i]^(b[i]-2);                  4 * theta[i]^2 * b[i]*(b[i]-1) * DELTA[i]^(b[i]-2);
314            
315          (*d2PSI_dtau2_expr:*) d2PSI_dtau2[i] = (2 * D[i] * t1^2 - 1) * 2 * D[i] * PSI[i];          (*d2PSI_dtau2_expr:*) d2PSI_dtau2[i] = (2 * D[i] * t1^2 - 1) * 2 * D[i] * PSI[i];
316    
317          (*d2PSI_ddeltadtau_expr:*) d2PSI_ddeltadtau[i] = 4 * C[i] * D[i] * d1 * t1 * PSI[i];          (*d2PSI_ddeltadtau_expr:*) d2PSI_ddeltadtau[i] = 4 * C[i] * D[i] * d1 * t1 * PSI[i];
318            
319          (*d2DELTAbi_ddeltadtau_expr:*) d2DELTAbi_ddeltadtau[i] = -A[i] * b[i]*2/beta_r4[i] *          (*d2DELTAbi_ddeltadtau_expr:*) d2DELTAbi_ddeltadtau[i] =
320                  DELTA[i]^(b[i]-1) * d1 * (d1^2)^(1/(2*beta_r4[i])-1) -                  - A[i] * b[i]* (2/beta_r4[i]) * DELTA[i]^(b[i]-1) * d1 * (d1^2)^(1/(2*beta_r4[i])-1)
321                  2 * theta[i] * b[i] *(b[i]-1) * DELTA[i]^(b[i]-2) *                  - 2 * theta[i] * b[i] *(b[i]-1) * DELTA[i]^(b[i]-2) * dDELTA_ddelta[i];
                 dDELTA_ddelta[i];  
322    
323      END FOR;      END FOR;
324    
# Line 372  MODEL steam_state; Line 371  MODEL steam_state;
371                      DELTA[i]^b[i]*dPSI_dtau[i])                     | i IN range_r4 ];                      DELTA[i]^b[i]*dPSI_dtau[i])                     | i IN range_r4 ];
372    
373    
374    
375      phirdeltadelta_r1[range_r1] IS_A factor;      phirdeltadelta_r1[range_r1] IS_A factor;
376      FOR i IN range_r1 CREATE      FOR i IN range_r1 CREATE
377          phirdeltadelta_r1[i] =          phirdeltadelta_r1[i] =
# Line 393  MODEL steam_state; Line 393  MODEL steam_state;
393      phirdeltadelta_r3[range_r3] IS_A factor;      phirdeltadelta_r3[range_r3] IS_A factor;
394      FOR i IN range_r3 CREATE      FOR i IN range_r3 CREATE
395          phirdeltadelta_r3[i] =          phirdeltadelta_r3[i] =
396              n[i]*(tau^t[i])*exp( r3_b1[i] )*              n[i]* tau^t[i] * exp( r3_b1[i] ) * (
397                      (-2*alpha[i]*(delta^d[i]) +                      - 2 * alpha[i] * delta^d[i]
398                      4*alpha[i]*alpha[i]*(delta^d[i])*d1^2 -                      + 4 * alpha[i]^2 * delta^d[i] * d1^2 (* d1 = d-1 = d-eps *)
399                      4*d[i]*alpha[i]*(delta^(d[i]-1))*d1 +                      - 4 * d[i] * alpha[i] * delta^(d[i]-1) * d1
400                      d[i]*(d[i]-1)*(delta^(d[i]-1)));                      + d[i] * (d[i]-1) * delta^(d[i]-2)
401                    );
402      END FOR;      END FOR;
403    
404      phirdeltadelta_r4[range_r4] IS_A factor;      phirdeltadelta_r4[range_r4] IS_A factor;
# Line 416  MODEL steam_state; Line 417  MODEL steam_state;
417          + SUM [phirdeltadelta_r3[i] | i IN range_r3 ]          + SUM [phirdeltadelta_r3[i] | i IN range_r3 ]
418          + SUM [phirdeltadelta_r4[i] | i IN range_r4 ];          + SUM [phirdeltadelta_r4[i] | i IN range_r4 ];
419    
420    
421    
422      phirtautau_r2[range_r2] IS_A factor;      phirtautau_r2[range_r2] IS_A factor;
423      FOR i IN range_r2 CREATE      FOR i IN range_r2 CREATE
424          phirtautau_r2[i] = n[i]*t[i]*(t[i]-1)* delta^d[i] *          phirtautau_r2[i] = n[i]*t[i]*(t[i]-1)* delta^d[i] *
# Line 481  MODEL steam_state; Line 484  MODEL steam_state;
484          = - R * tau^2 * (phi0tautau + phirtautau);          = - R * tau^2 * (phi0tautau + phirtautau);
485    
486      c_isobaric: cp      c_isobaric: cp
487          = - R * tau^2 * (phi0tautau + phirtautau) +          = - R * (
488              ( 1 + delta*phirdelta - delta*tau*phirdeltatau )^2                tau^2 * (phi0tautau + phirtautau)
489              / (  1 + 2*delta*phirdelta + delta*delta*phirdeltadelta );                +  ( ( 1 + delta*phirdelta - delta*tau*phirdeltatau )^2 )
490                     / (  1 + 2*delta*phirdelta + delta^2 * phirdeltadelta )
491              );
492    
493      spd_sound: w      spd_sound: w
494          = sqrt(R * T * ( 1 + 2*delta*phirdelta + delta^2 * phirdeltadelta -          = sqrt(R * T * ( 1 + 2*delta*phirdelta + delta^2 * phirdeltadelta -
495                  ( 1 + delta*phirdelta - delta*tau*phirdeltatau )^2                  ( 1 + delta*phirdelta - delta*tau*phirdeltatau )^2
496                  / (  tau^2 * (phi0tautau + phirtautau) )                  / (  tau^2 * (phi0tautau + phirtautau) )
497              ));            ));
498    
499    
500  METHODS  METHODS
# Line 505  METHOD specify; Line 510  METHOD specify;
510  END specify;  END specify;
511    
512  METHOD values;  METHOD values;
513      T := 290 {K};      (* these are the test values from page 14 of the IAPWS-95 release *)
514      rho := 999 {kg/m^3};      T := 500 {K};
515        rho := 838.025 {kg/m^3};
516  END values;  END values;
517    
518  END steam_state;  END steam_state;

Legend:
Removed from v.95  
changed lines
  Added in v.96

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22