{"action":"opened","issue":{"url":"https://api.github.com/repos/richardotis/pycalphad/issues/22","labels_url":"https://api.github.com/repos/richardotis/pycalphad/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/richardotis/pycalphad/issues/22/comments","events_url":"https://api.github.com/repos/richardotis/pycalphad/issues/22/events","html_url":"https://github.com/richardotis/pycalphad/issues/22","id":106010899,"number":22,"title":"Apparent error in calculation of driving force","user":{"login":"broshe","id":13480270,"avatar_url":"https://avatars.githubusercontent.com/u/13480270?v=3","gravatar_id":"","url":"https://api.github.com/users/broshe","html_url":"https://github.com/broshe","followers_url":"https://api.github.com/users/broshe/followers","following_url":"https://api.github.com/users/broshe/following{/other_user}","gists_url":"https://api.github.com/users/broshe/gists{/gist_id}","starred_url":"https://api.github.com/users/broshe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broshe/subscriptions","organizations_url":"https://api.github.com/users/broshe/orgs","repos_url":"https://api.github.com/users/broshe/repos","events_url":"https://api.github.com/users/broshe/events{/privacy}","received_events_url":"https://api.github.com/users/broshe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-11T13:27:25Z","updated_at":"2015-09-11T13:27:25Z","closed_at":null,"body":"Hi Richard,\r\nI installed pycalphad 0.2.1\r\npycalphad.__version__\r\n'0.2.1'\r\n\r\nNow I tried to calculate the driving force for precipitation of the Al13Fe4 phase from liquid Al-Fe at x(Fe)=0.1\r\n\r\nHere is the script:\r\n\r\nfrom pycalphad import Database, binplot, equilibrium\r\nimport pycalphad.variables as v\r\nfrom numpy import *\r\nfrom pylab import *\r\n\r\ndb = Database('/home/ebrosh/Documents/ebroshWorks/tcworks/Al-Fe-solidification/alfe_sei.TDB')\r\n\r\nR=8.31451\r\nT=arange(1000,2001,20)\r\nxAl=.9\r\nxFe=1-xAl\r\ndata = equilibrium(db, ['AL', 'FE'], 'LIQUID', {v.X('AL'): xAl, v.T: T, v.P: 1e5},verbose=False)\r\n\r\nmuFe=data['MU'].sel( component='FE').data[0].flatten()\r\nmuAl=data['MU'].sel( component='AL').data[0].flatten()\r\n\r\n\r\ndata = equilibrium(db, ['AL', 'FE','VA'], 'AL13FE4', {v.X('AL'): 13/17.0, v.T: T, v.P: 1e5},verbose=False)\r\nG=data['GM'].data[0].flatten()\r\n\r\n\r\ndGM=-(G-xAl*muAl-xFe*muFe)/R/T\r\n\r\n\r\nfigure(1)\r\nplot(T,dGM,'g')\r\n![dgm](https://cloud.githubusercontent.com/assets/13480270/9815282/7bfda1a8-589d-11e5-98ef-acfe6258cf55.png)\r\n\r\n\r\nshow(block=False)\r\n\r\n\r\nThe calculation gives positive driving force below 1800 K.\r\nIt should be positive below ~1250 K as can be seen on the Al-Fe phase diagram.\r\nA corresponding result of a thermo-calc calculation is also attached (with the correct result).\r\n![dgm_thermocalc](https://cloud.githubusercontent.com/assets/13480270/9815688/aaa78af2-58a0-11e5-9939-1652f10536b8.png)\r\n\r\nIt seems that the calculation of the Gibbs energy of Al13Fe4  is erroneous in pycalphad\r\n\r\nFor reference, Gm(Al13Fe4) mu(Al) and mu(Fe) at T=2000 x(Al)=0.9 x(Fe)=.1 are given\r\n\r\npycalphad:\r\nmu(Al)=-130684.44533461\r\nmu(Fe)=-202444.57089581\r\nGm(Al13Fe4)=-134716.70446316\r\n\r\nThermo-calc:\r\nmu(Al)=-130684.45\r\nmu(Fe)=-202444.6\r\nGm(Al13Fe4)=-136221.09\r\n\r\nEli "}}