Fluids

Fluids

How strain rate works in Herschel-Bulkley viscosity model?

    • uditkumar007
      Subscriber
    • Rob
      Ansys Employee
      It'll be covered in the documentation, check in Materials in the User's Guide. It is also possible to write a UDF for the model (I've done it for other viscosity models), ask your supervisor to look on the Ansys Customer Portal for the Carreau-Yasuda model. n
    • uditkumar007
      Subscriber
      Dear Sir,nThank You for answering.nIs it not written yet? I didn't find anything on strain rate on the user manual. I am running the 2020R2 student version for a research purpose. nIs there any tutorial on how I can write a UDF for Herschel-Bulkley viscosity model?Thank You Sir. n
    • DrAmine
      Ansys Employee
      Why do you need an UDF?.nYou just need to provide proper input.n
    • DrAmine
      Ansys Employee
      Viscosity to be prescribed as UDF via DEFINE_PROPERTY or as expression.n
    • uditkumar007
      Subscriber
      Dear Dr. Amine Sir,nSir, the fluid in my project is drilling fluid which follows the Herschel-Bulkley viscosity model. So for a proper analysis I need the UDF. I need to compare my results with another model to validate my results. The other model used Herschel-Bulkley viscosity model UDF. nYes Sir. But I need a whole tutorial on how to write the UDF in C++ or C language, since I also have to specify the critical stress, flow behavior index, consistency index and yield stress and I don't know how it's done. Is there any?nI saw in Ansys 2020R2 there is a new window Strain Rate in Herschel-Bulkley viscosity model. Looked for it in the user manual but there is nothing there on Strain rate and how it works.nnThank You Sir for answering. n
    • Rob
      Ansys Employee
      There's an example for DEFINE_PROPERTY in the manual, and Section 3.2.3.9 Derivative Macros of the 2020R2 UDF manual will help. There is an example on the Customer Portal that your supervisor (ie registered Ansys contact) can access: we're not permitted to share it on here. n
    • DrAmine
      Ansys Employee
      : why do you need an UDF? Do you need another flavour of the in-built approach?n
    • uditkumar007
      Subscriber
      Dear Rob Sir,nnThank you Sir I will look into it. Sir, sadly my supervisor isn't registered as Ansys contact. I have to solve this by myself. n n
    • uditkumar007
      Subscriber
      Dear Dr Amine Sir,nSir, I am not sure the UDF I want to run whether the built-in approach covers it. Also there is a new window called Strain rate there isn't anything mentioned about Strain Rate and how it works in the User manual of Ansys 2020R2.nSir I wrote this code with the help of my supervisor, not sure how to run it though and if the build in approach covers this code or not. I am posting it here,nn#include udf.hnFILE *fp;nDEFINE_PROPERTY(hb_viscosity, c, t)n{nreal viscosity;nreal stress;nreal ys;nreal n, m;nreal k;nreal Max, Min;nn = 0.94; nys = 4.022; nk = 0.04; nm = 1000;nMax = 100000;nMin = 0.00000000001;nstress = C_STRAIN_RATE_MAG(c,t);nviscosity = ys*(1-exp(-m*stress))/stress + k*pow(stress,n-1);nreturn viscosity;n}nnCan you tell me how can I run this UDF? Every time I try to interpret the UDF and run it, I receive this error. Without the UDF the model runs fine.n
    • Rob
      Ansys Employee
      You may want to alter the min and max to more realistic values. Gases tend to be around 1e-5 and tar is about 5 (rough guess). The range you have may be responsible for the problem, especially if the initial turbulence values are nonphysical. n
    • uditkumar007
      Subscriber
      Sir, I am using drilling fluid as the fluid material. Drilling Fluid follows the Herschel-Bulkley viscosity model. The values of k, n and Yield stress are given.nk = 0.04;nn = 0.94;nys = 4.022 Pa;nWhat should be the values count , max and min values in this strain rate section for Drilling fluids? The values are kind of fixed. No matter what I number I put, it changes back to the default values expect for Count. We can only change the values of Count from 10-1000 range.n
    • uditkumar007
      Subscriber
      Yes sir I did so. But the max and min number in strain rate doesn't change whatever I put. It stays 500 and 300 by default. Why is this happening? n
    • Rob
      Ansys Employee
      Have you added data for k, n, yield and critical shear and OK'd the input? The min and max are for the display, from what you've shown there's nothing to display n
    • uditkumar007
      Subscriber
      Yes Sir I did. I tried to change the max, min and count values according to the UDF. But the max and min value doesn't change. The default values doesn't change. nn
    • uditkumar007
      Subscriber
      For the UDF, I changed the range for max and min still I am receiving the same error. Is there anything with the code? nWhen I interpret the code it doesn't show any error though. Where is the problem? My mesh quality is fine too. nSkewness: Max = 0.72nOrthogonal quality: Min = 0.33 n
    • Rob
      Ansys Employee
      What error are you seeing? n
    • uditkumar007
      Subscriber
      Sir the same error as before.The error message is like this:nniter continuity x-velocity y-velocity z-velocity time/iternStabilizing x-momentum to enhance linear solver robustness.nStabilizing x-momentum using GMRES to enhance linear solver robustness.nnDivergence detected in AMG solver: x-momentum Stabilizing y-momentum to enhance linear solver robustness.nStabilizing y-momentum using GMRES to enhance linear solver robustness.nnDivergence detected in AMG solver: y-momentum Stabilizing z-momentum to enhance linear solver robustness.nStabilizing z-momentum using GMRES to enhance linear solver robustness.nnDivergence detected in AMG solver: z-momentum Stabilizing pressure correction to enhance linear solver robustness.nStabilizing pressure correction using GMRES to enhance linear solver robustness.nnDivergence detectednError at Node 0: floating point exceptionnin AMG solver: pressure correctionnError at host: floating point exceptionnn===============Message from the Cortex Process================================nnCompute processes interrupted. Processing can be resumed.nn==============================================================================nnError: floating point exceptionnError Object: #fnRegistering Udf, (\2020 R2 new\vis.c)nnCalculation complete.n
      Add Tags