-
-
September 11, 2018 at 2:15 pm
liliana_augusto
SubscriberHello all,
I am simulating a flow between two paralell plates, of a non-newtonian fluid (Herschel Bulkley). For the calculation of the viscosity I have used a UDF.
I have two problems: if I compiled the UDF and initialize the simulation, I got this error:
Divergence detected in AMG solver: x-momentum
Divergence detected in AMG solver: y-momentum
Divergence detected in AMG solver: pressure correction
Error at host: floating point exception
# Divergence detected in AMG solver: x-momentum -> Increasing relaxation sweeps!
Error at Node 0: floating point exception
# You may try the enhanced divergence recovery with (rpsetvar 'amg/protective-enhanced? #t)
I have tried to decrease the relaxation factor, but it did not solve it...
So I have tried to start the simulation with a newtonian fluid (using "k" of HB equation) and then continue the simulation with the UDF. Although, depending on the initial state I used, I got a different result. Is this normal? Has anyone have any suggestion to start the simulation with the UDF.
The weird thing is: if I set tau0 to zero (like a power law viscosity), the results are in very good agreement with the analytical solution. If I use a fluid with a non-zero tau0, I have this issue.
Here are the UDF:
#include "udf.h"
FILE *fp;
DEFINE_PROPERTY(hb_viscosity, c, t)
{
real vis;
real shear;
real ys;
real n;
real m;
real k;
real Max, Min;
n = 0.797; /* Power Law Index */
ys = 189; /* Initial Yield Stress */
k = 4.1; /* Fluid Consistency */
m = 100000000;
Max = 100000000;
Min = 0.00000000001;
shear = C_STRAIN_RATE_MAG(c,t);
vis = ys*(1-exp(-m*shear))/shear + k*pow(shear,n-1);
return vis;
}
Thanks!
-
September 11, 2018 at 2:40 pm
Karthik R
AdministratorHello,
Couple of question:
- Did you get any compilation errors? It seems like you were able to run the simulation without the UDF.
- What are your initial velocities (are they being computed from inlet or are you using 0 m/s)?
- Are you solving a steady model? Did you let the model converge before turning on the UDF? If you are, depending on where you start using the UDF, it is not uncommon that you are getting a different steady state solution. Your UDF is computing a viscosity based on the shear rate (at a certain iteration) and this makes the momentum equation non-linear (shear stress terms). Therefore, each time you have a different shear rate, you might get a different value.
- Please plot vis vs. shear rate curve for your model and make sure your starting conditions are physical. I am suspecting that your initial viscosity is not physical and therefore, you are seeing a divergence. The fact that you are seeing different solution based for different number of iterations might be complimenting this. Could you please plot this and share the plot here?
- I do not understand your tau0 question. Right now, you do not have a tau0 term in your model. Are you talking about initial yield stress?
I hope this helps.
Best Regards,
Karthik
-
September 11, 2018 at 2:51 pm
liliana_augusto
SubscriberHi!
Not, the UDF is compiled ok. I got no errors. The simulation runs fine without UDF. It also runs with the UDF, but if I use for example a previous result I got with Newtonian fluid, I also runs, but did not converge to a good solution (very bad agreement with analytical solution).
I used Hybrid Initialization and the run the simulation. If I do this with UDF, I got that erros that I sent previosly. Even if I decrease relaxation factors.
Yes, it is steady model.
I will try to plot what you said.
The problem with tau0: If I simulate a fluid with a yield stress, the results are not good. But if I simulate a fluid with no yield stress (tau0), using same UDF just setting tau0=0, the results are in very good agreement with analytical solution.
Thanks!
-
September 11, 2018 at 2:51 pm
liliana_augusto
SubscriberSome details of the simulation:
Inlet: Pressure-inlet 30kPa
Outlet: Pressure-outlet 0
-
September 11, 2018 at 3:00 pm
-
September 11, 2018 at 3:34 pm
Rob
Ansys EmployeeI'd suggest dropping the maximum down to around 10: if it's too viscous it'll mess with the numerics and much above 0.1 and it'll not move much anyway! Also, try using a velocity inlet to get the model started. What does the solution look like if you plot viscosity contour across the channel (node values off)?
-
September 11, 2018 at 5:15 pm
liliana_augusto
SubscriberHi!
You mean drop the maximum down of the shear rate? How do I do this in Fluent? The graph is generic, just a plot of HB equation with the parameters I am using in the simulation.
The problem is that I got the pressure difference from experimental data, not the velocity... That is why I was using pressure inlet and outlet. It should be a problem using pressure at inlet AND outlet?
The contour of the molecular viscosity is quite messy...
-
September 11, 2018 at 5:21 pm
liliana_augusto
SubscriberEven with velocity inlet I got the divergence problem at the beggining.
-
September 11, 2018 at 9:25 pm
Karthik R
AdministratorHello,
The reason you are seeing divergence in your model is because your starting viscosity is unnatural for a fluid and Fluent is having tough time handling this viscosity. Please make sure your viscosity and shear-stress are reasonable. One thing you could try is to use only a small portion of your viscosity - shear rate curve (where the material still behaves similar to a fluid). A viscosity of 10^6 for a fluid is unrealistic and it is essentially a solid.
Please let us know what you find.
Thank you.
Best Regards,
Karthik
-
September 11, 2018 at 9:32 pm
liliana_augusto
SubscriberThe curve is just generic... I plotted the HB equation for a big interval of shear rate and viscosity.
FOR THE SIMULATION, I am using k as 4.1. So at the beggining I set the viscosity of the fluid as 4.1 and then turn on the UDF, with k also as 4.1.
The viscosity does not reach a value of 10^6 at all.
-
September 11, 2018 at 9:51 pm
liliana_augusto
SubscriberI check the results (although I am not sure if it is correct...) and the strain rate is reaching 280 1/s and molecular viscosity is reaching 4200 Pa at the center.
-
September 12, 2018 at 10:14 am
Rob
Ansys EmployeeThat's pretty much plug flow in the middle and (probably) a low viscosity at the wall. Check the mesh resolution near the wall.
-
- 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
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
-
2706
-
2142
-
1355
-
1144
-
462
© 2023 Copyright ANSYS, Inc. All rights reserved.