-
-
January 24, 2021 at 10:37 am
uditkumar007
SubscriberHello,nI have written a UDF code for the Herschel-Bulkley viscosity model. nCODE:n#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);nnviscosity = ys*(1-exp(-m*stress))/stress + k*pow(stress,n-1);nnreturn viscosity;n}nnI am receiving an AMG solver error when I try to run the solution. Which equation does ANSYS use to calculate the viscosity?nWhen I try to use the in-built Herschel-Bulkley model, I don't get a stable value from the Grid sensitivity analysis. Any kind of help will be very kind.nThanks.n -
January 25, 2021 at 11:16 am
Rob
Ansys EmployeeOther than defining the variables as REAL and then giving an INTEGER value it looks OK. Check the maths of the viscosity, and where are Min and Max used? Is the UDF returning a positive value?.If you're not getting a stable result with a refined mesh have a very careful look at the results. You may be finding new details in the flow (ie it's not yet mesh dependent) or your monitors may be picking up some transients in the flow. Hard to say without seeing pictures of the flow field. n -
January 25, 2021 at 12:20 pm
uditkumar007
SubscriberSir, I was receiving a floating-point error too. Maybe the stress was tending to 0 or equal to 0. So the UDF wasn't returning a positive value. So I tried it with an if loop. n{nif (stress<= 0)nstress = 10;n}nnThe solution was running. But I wasn't getting the desired values with this modificationnBut when I changed the Boundary conditions it's running fine. I guess I need to tweak this a little bit to get the desired values. nSir, I am not sure what the max and min value does. I saw this in a reference and also in ANSYS FLUENT 2020R2 there are Max Min And Count values in the strain rate section. Not sure what it does. Thank You Sir for your precious suggestions. n -
January 25, 2021 at 2:05 pm
Rob
Ansys EmployeeMost viscosity models have a limit to prevent the fluid value exceeding a sensible range, maybe it relates to that (I've not looked). n -
January 25, 2021 at 6:06 pm
uditkumar007
SubscriberThank You Sir for your kind suggestions.n
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- Difference between K-epsilon and K-omega Turbulence Model
- The solver failed with a non-zero exit code of : 2
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error: Received signal SIGSEGV
-
5290
-
3311
-
2471
-
1308
-
1016
© 2023 Copyright ANSYS, Inc. All rights reserved.