Fluids

Fluids

How to resolve “WARNING: Invalid cp (-2.235390e+03 J/kgK) for gadolinium at temperature 1.000000 K”?

    • pc_singh
      Subscriber
      nI am getting WARNING: Invalid cp (-2.235390e+03 J/kgK) for gadolinium at temperature 1.000000 K error. I have compiled specific heat udf. nCan someone correct the udf below? Please Suggest Changes Required.nDEFINE_SPECIFIC_HEAT(CP, T, Tref, h, yi)n{ntreal CP_0, CP_1, CP, CP_dot5, B, Time;nt/*Setting up the magnetic field*/ntTime = CURRENT_TIME;ntfor(;;)n    {n    tif(Time<=4.2)n      ttbreak;n    tTime=Time-4.2;n  t}n            if(Time<=0.1)n    tttB=7*Time+0.3;n  tttif(Time<=2.1 && Time>0.1)n    tttB=1;n  tttif(Time>2.1 && Time<=2.2)n    tttB=-7*Time+15.7;n  tttif(Time>2.2)n    tttB=0.3;tn           /*Calculating CP*/n            if(T<=288.60 )n                    CP_0=0.017275*T*T-7.201999*T+984.900000004;nt            elsent            {nt            if(T<=292.4866)nt            tCP_0=-27.98559*T+8431.999941;nt            elsent            tCP_0=0.02421075*T*T-16.2260213*T+2916.68679;n             t}n             if(T<=287.0577)n                    CP_dot5=54.7513501*exp(0.00615364381*T);nt            elsent            {nt         if(T<=292.4247)nt            tCP_dot5=0.14988*T*T-94.2584*T+15031.3045;nt            elsent            tCP_dot5=0.150563*T*T-94.47235*T+15032.60325;n             t}tn             if(T<=287.4382)n                    CP_1=-0.0408*T*T+23.65002936*T-3125.9999;nt            elsent            {nt         if(T<=298.1055)nt            tCP_1=-0.1694534*T*T+96.069998*T-13314;nt            elsent            tCP_1=0.1209901*T*T-76.7138035*T+12379.99999;n             t}tn             if(B<=0.5)n             t    CP=CP_0+(CP_dot5-CP_0)*(B/0.5);n             telsen             t    CP=CP_dot5+(CP_1-CP_dot5)*((B-0.5)/0.5);n             t Message(The value of CP is %g
      ,CP);nn                *h = CP*(T-Tref);nt            return CP;tn}    n
    • DrAmine
      Ansys Employee
      Have you checked the values of Cp outside Fluent?nYou can first help the solver by limiting the temperature for the first iteration to a reasonable narrow interval.n
    • pc_singh
      Subscriber
      Thank you for your kind reply.nHow can I limit the temperature for the first iteration?n
    • Rob
      Ansys Employee
      Solution - Controls - Limits nI'd set the minimum temperature to be 20K or so below what you're expecting to get it going. Do NOT consider the model to be converged if you're bouncing off the limiter! n
    • pc_singh
      Subscriber
      Sir, still getting same error.nnWARNING: Invalid cp (-8.863752e+00 J/kgK) for gadolinium at temperature 20.000000 K
    • Rob
      Ansys Employee
      If you put 20K into the cp formula what do you get? I also suggested 20K BELOW your expected minimum temperature, not 20K temperature. n
    • pc_singh
      Subscriber
      sir I have checked it on 280K and 290K too, but got same error.nBy manual calculation, I am getting positive value at 20K.n
    • DrAmine
      Ansys Employee
      Further details required about the case: mixture properties or single component flow? Are you seeing the error after initialization? (Please do not attach pictures just include them in the answer)n
    • pc_singh
      Subscriber
      Case scenario : Flow of water between parallel plates of Gadolinium( Gd). The specific heat of Gd is property of both the temperature and magnetic field. No sir, I am seeing this error during simulation.n
    • Rob
      Ansys Employee
      In Excel plot the whole temperature range to see what's going on.
    • pc_singh
      Subscriber
      after simulation?n
    • Rob
      Ansys Employee
      No, plot the relationship you've put into the UDF. Whenever you need 9+ significant figures in a relationship there's a good chance something will go wrong. n
    • pc_singh
      Subscriber
      Ok sir.n
Viewing 12 reply threads
  • You must be logged in to reply to this topic.