Changeset 439 for trunk/matml

Show
Ignore:
Timestamp:
03/16/2009 05:38:15 PM (3 years ago)
Author:
powell
Message:

New "square" free energy parameters and terms, changed M* to S*.

Location:
trunk/matml/src/ternary
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/matml/src/ternary/ChangeLog

    r430 r439  
    1111  * Added WITH_DERIVATIVES and NO_INFINITY options to free energies(). 
    1212  * Added spinodal.c with calc_spinodal function returning a phase_boundary. 
     13  * New "square" free energy parameters for pseudo-square representation. 
    1314 
    1415 -- 
  • trunk/matml/src/ternary/freenergy.c

    r420 r439  
    6363    +*/ 
    6464  return G1 + (G2-G1)*C2 + (G3-G1)*C3 
    65     + eparams->R*T*(((C1<=0.) ? 0. : C1/eparams->M1*log(C1)) 
    66                     + ((C2<=0.) ? 0. : C2/eparams->M2*log(C2)) 
    67                     + ((C3<=0.) ? 0. : C3/eparams->M3*log(C3))) 
     65    + eparams->R*T*(  ((C1<=0.) ? 0. : eparams->S1*C1*log(C1)) 
     66                    + ((C2<=0.) ? 0. : eparams->S2*C2*log(C2)) 
     67                    + ((C3<=0.) ? 0. : eparams->S3*C3*log(C3)) 
     68                    + ((C2>=1.) ? 0. : eparams->S4*(1.-C2)*log(1.-C2)) 
     69                    + ((C3>=1.) ? 0. : eparams->S5*(1.-C3)*log(1.-C3))) 
    6870    + eparams->Omega12*C1*C2 + eparams->Omega13*C1*C3 + eparams->Omega23*C2*C3 
    6971    + eparams->Omega123*C1*C2*C3; 
     
    114116    +*/ 
    115117  return G2-G1 
    116     + eparams->R*T*(((C2+C3>=1) ? LOCAL_INFINITY : (-log(C1)-1)/eparams->M1) 
     118    + eparams->R*T*(((C2+C3>=1) ? LOCAL_INFINITY : eparams->S1*(-log(C1)-1)) 
    117119                    + ((C2<=0.) ? LOCAL_NEGATIVE_INFINITY : 
    118                        (log(C2)+1)/eparams->M2)) 
     120                       eparams->S2*(log(C2)+1)) 
     121                    + ((C2>=1.) ? LOCAL_INFINITY : 
     122                       eparams->S4*(-1.-log(1.-C2)))) 
    119123    + eparams->Omega12*(C1-C2) - eparams->Omega13*C3 + eparams->Omega23*C3 
    120124    + eparams->Omega123*(C1-C2)*C3; 
     
    158162{ 
    159163  return G3-G1 
    160     + eparams->R*T*(((C2+C3>=1) ? LOCAL_INFINITY : (-log(C1)-1)/eparams->M1) 
     164    + eparams->R*T*(((C2+C3>=1) ? LOCAL_INFINITY : eparams->S1*(-log(C1)-1)) 
    161165                    + ((C3<=0.) ? LOCAL_NEGATIVE_INFINITY : 
    162                        (log(C3)+1)/eparams->M3)) 
     166                       eparams->S3*(log(C3)+1)) 
     167                    + ((C3>=1.) ? LOCAL_INFINITY : 
     168                       eparams->S5*(-1.-log(1.-C3)))) 
    163169    - eparams->Omega12*C2 + eparams->Omega13*(C1-C3) + eparams->Omega23*C2 
    164170    + eparams->Omega123*(C1-C3)*C2; 
     
    204210{ 
    205211  return 
    206     eparams->R*T*(((C2+C3>=1) ? LOCAL_INFINITY : 1./C1/eparams->M1) 
    207                   + ((C2<=0.) ? LOCAL_INFINITY : 1./C2/eparams->M2)) 
     212    eparams->R*T*(((C2+C3>=1) ? LOCAL_INFINITY : eparams->S1/C1) 
     213                  + ((C2<=0.) ? LOCAL_INFINITY : eparams->S2/C2) 
     214                  + ((C2>=1.) ? LOCAL_INFINITY : 
     215                     eparams->S4/(1.-C2))) 
    208216    - eparams->Omega12*2 - eparams->Omega123*2*C3; 
    209217} 
     
    248256{ 
    249257  return 
    250     eparams->R*T*(((C2+C3>=1) ? LOCAL_INFINITY : 1./C1/eparams->M1) 
    251                   + ((C3<=0.) ? LOCAL_INFINITY : 1./C3/eparams->M3)) 
     258    eparams->R*T*(((C2+C3>=1) ? LOCAL_INFINITY : eparams->S1/C1) 
     259                  + ((C3<=0.) ? LOCAL_INFINITY : eparams->S3/C3) 
     260                  + ((C3>=1.) ? LOCAL_INFINITY : 
     261                     eparams->S5/(1.-C3))) 
    252262    - eparams->Omega13*2 - eparams->Omega123*2*C2; 
    253263} 
     
    292302{ 
    293303  return 
    294     eparams->R*T*((C2+C3>=1) ? LOCAL_INFINITY : 1./C1/eparams->M1) 
     304    eparams->R*T*((C2+C3>=1) ? LOCAL_INFINITY : eparams->S1/C1) 
    295305    - eparams->Omega12 - eparams->Omega13 + eparams->Omega23 
    296306    + eparams->Omega123*(2*C1-1); 
  • trunk/matml/src/ternary/ternary.c

    r432 r439  
    3737  /* eparams: R,T0, G1@T0,G2,G3, C1,C2,C3, M1,M2,M3, O12,O13,O23,O123 */ 
    3838  energy_params /* Solid, liquid */ 
    39     eparams0 = {"Solid", 1.,1., 0.,-.1,-.2, -1.,-1.1,-1.2, 1.,2.,5., -.5,2.,.2, 0.}, 
    40     eparams1 = {"Liquid", 1.,1., .3,.1,-.1, -2.2,-2.,-1.8, 1.,1.,1.5, -.3,-.4,-.1, -.5}, 
     39    eparams0 = {"Solid", 1.,1., 0.,-.1,-.2, -1.,-1.1,-1.2, 1.,.5,.2,0.,0., -.5,2.,.2, 0.}, 
     40    eparams1 = {"Liquid", 1.,1., .3,.1,-.1, -2.2,-2.,-1.8, 1.,1.,.67,0.,0., -.3,-.4,-.1, -.5}, 
    4141      allparams[2] = {eparams0, eparams1}; 
    4242 
  • trunk/matml/src/ternary/ternary.h

    r435 r439  
    8787  double G2_C;     /*+ Species 2 heat capacity +*/ 
    8888  double G3_C;     /*+ Species 3 heat capacity +*/ 
    89   double M1;       /*+ Species 1 Flory-Huggins relative molar volume +*/ 
    90   double M2;       /*+ Species 2 Flory-Huggins relative molar volume +*/ 
    91   double M3;       /*+ Species 3 Flory-Huggins relative molar volume +*/ 
     89  double S1;       /*+ Species 1 entropy coefficient (inverse Flory-Huggins relative molar volume) +*/ 
     90  double S2;       /*+ Species 2 entropy coefficient +*/ 
     91  double S3;       /*+ Species 3 entropy coefficient +*/ 
     92  double S4;       /*+ 1-C2 entropy coefficient for square system +*/ 
     93  double S5;       /*+ 1-C3 entropy coefficient for square system +*/ 
    9294  double Omega12;  /*+ Species 1-2 regular solution interaction parameter +*/ 
    9395  double Omega13;  /*+ Species 1-3 regular solution interaction parameter +*/