-
-
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 Remella
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
Forum ModeratorI'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 Remella
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
Forum ModeratorThat's pretty much plug flow in the middle and (probably) a low viscosity at the wall. Check the mesh resolution near the wall.Â
-
- The topic ‘Initialization and Initialization with UDF’ is closed to new replies.
- air flow in and out of computer case
- Varying Bond model parameters to mimic soil particle cohesion/stiction
- Eroded Mass due to Erosion of Soil Particles by Fluids
- I am doing a corona simulation. But particles are not spreading.
- Centrifugal Fan Analysis for Determination of Characteristic Curve
- Guidance needed for Conjugate Heat Transfer Analysis for a 3s3p Li-ion Battery
- Issue to compile a UDF in ANSYS Fluent
- JACOBI Convergence Issue in ANSYS AQWA
- affinity not set
- Resuming SAG Mill Simulation with New Particle Batch in Rocky
-
4092
-
1487
-
1318
-
1156
-
1021
© 2025 Copyright ANSYS, Inc. All rights reserved.