CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Bingham Fluid - UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By blackmask

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 3, 2018, 17:13
Default Bingham Fluid - UDF
  #1
Member
 
Liliana de Luca Xavier Augusto
Join Date: Feb 2013
Posts: 69
Rep Power: 13
liliana is on a distinguished road
Hi all,

does anyone here works with NonNewtonian fluids?

I implemented a UDF for calculate the viscosity for a Bingham fluid in a 2D pipe. As BC at inet, I set a pressure 58.86 Pa and at outlet P = 0.

The geometry has 0.002m radius and 0.006m length. The flow is laminar, steady state.

However, when I compare the results of Fluent with analytical solution, it does not match (see picture, there 3 graphs for different values of yield stress). I am not sure if the problem is the UDF. Does anyone have any idea of can be wrong or has the same problem?

k = 1 Pa.s
tau0 = 1.0; 3.0; 5.0 Pa (three simulations with three differente values)

The theoretical equations:

v = (dP/dL) * (Rē - rē)/(4*k) - tau0*(R-r)/k (for non-plug region)

v = (dP/dL) * (Rē/4*k) * (1 - Rp/R)^2 (for plug region)
with Rp = 2*L*tau0/dP

The picture: https://drive.google.com/open?id=1tn...UYPuTsV6sWnoRE

Here are the UDF:

/* UDF for Bingham fluid (Bingham Papanastasiou model)*/
#include "udf.h"

FILE *fp;


/* ************************************************* */

/* Bingham Fluid */

DEFINE_PROPERTY(Bingham_viscosity, c, t)

{

/* Input Parameters for Bingham Viscosity */

real vis;
real stress;
real ys;
real m;
real k;
real Max, Min;

ys = 5.0; /* Initial Yield Stress */
k = 1.0; /* Fluid Consistency */
m = 100000000;

Max = 100000000000;
Min = 0.00000000001;

stress = C_STRAIN_RATE_MAG(c,t);

/************ Bingham Fluid **********/

vis = k + ys*(1-exp(-m*stress))/stress;
/* vis = k; */

return vis;

}
liliana is offline   Reply With Quote

Old   September 3, 2018, 23:39
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
blackmask will become famous soon enough
Make sure that you have done
Code:
solve/set/expert
Keep temporary solver memory from being freed?
and answered "yes".

The picture is inaccessible.
liliana likes this.
blackmask is offline   Reply With Quote

Old   September 3, 2018, 23:43
Default
  #3
Member
 
Liliana de Luca Xavier Augusto
Join Date: Feb 2013
Posts: 69
Rep Power: 13
liliana is on a distinguished road
Quote:
Originally Posted by blackmask View Post
Make sure that you have done
Code:
solve/set/expert
Keep temporary solver memory from being freed?
and answered "yes".

The picture is inaccessible.
Hi! What does this code mean? I didnt get it, sorry... I guess the picture is accessible now.
liliana is offline   Reply With Quote

Old   September 3, 2018, 23:51
Default
  #4
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
blackmask will become famous soon enough
Simple type "solve/set/expert" in the TUI (text user interface) when you have to access gradient in your UDF. Also, it would be great to post the formulation of viscosity for Bingham flow. I can see what you code does, but I do not know what the code is supposed to do.
blackmask is offline   Reply With Quote

Old   September 3, 2018, 23:55
Default
  #5
Member
 
Liliana de Luca Xavier Augusto
Join Date: Feb 2013
Posts: 69
Rep Power: 13
liliana is on a distinguished road
Quote:
Originally Posted by blackmask View Post
Simple type "solve/set/expert" in the TUI (text user interface) when you have to access gradient in your UDF. Also, it would be great to post the formulation of viscosity for Bingham flow. I can see what you code does, but I do not know what the code is supposed to do.
I got it. I will try this. But what this command do exactly?

About the viscosity, I am trying to implement the equation (6) of this paper: https://drive.google.com/file/d/1gQ-...w?usp=drivesdk
liliana is offline   Reply With Quote

Old   September 4, 2018, 10:17
Default
  #6
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
blackmask will become famous soon enough
Well in this case you do not have to do that because the viscosity is needed in the momentum equation in which the strain rate is readily available. I think what you have done is right and the discrepancy when plug flow region appears is rather strange. However it might not be easy to figure out why. You might do a full 3D simulation to make sure that this is not an issue with the axis-symmetric implementation in FLUENT.
blackmask is offline   Reply With Quote

Old   September 4, 2018, 10:28
Default
  #7
Member
 
Liliana de Luca Xavier Augusto
Join Date: Feb 2013
Posts: 69
Rep Power: 13
liliana is on a distinguished road
Quote:
Originally Posted by blackmask View Post
Well in this case you do not have to do that because the viscosity is needed in the momentum equation in which the strain rate is readily available. I think what you have done is right and the discrepancy when plug flow region appears is rather strange. However it might not be easy to figure out why. You might do a full 3D simulation to make sure that this is not an issue with the axis-symmetric implementation in FLUENT.
I thought about it. But then I made a simulation without axisimetric, but still 2D, as a flow between two paralell plates. And I got the same problem.
liliana is offline   Reply With Quote

Old   September 26, 2018, 09:26
Default
  #8
New Member
 
Join Date: Mar 2016
Posts: 6
Rep Power: 10
saoYT is on a distinguished road
Hello liliana!

I'm currently facing the same problem as you, working with Herschel-Bulkley fluids with ANSYS Fluent.

The Herschel-Bulkley rheological model (for n = 1, we have the Bingham model) has a discontinuity on its function, since we have a yield stress. So, Fluent implements a regularization model to overcome this discontinuity (documented in the user's guide), using a "critical shear rate", which means that for shear rate < critical shear rate, the fluid will behave as a Newtonian Fluid with high viscosity, and for shear rate > critical shear rate the fluid will behave as a Herschel-Bulkley fluid (or Bingham fluid, in your case).

The udf you are showing makes a different regularization for this problem, with the Papanastasiou Model, which depends on the "m" parameter. The literature recomends m = 1000s (LABSI, 2016, "Herschel-Bulkley fluid flow within a pipe by taking into account viscous dissipation"), however i'm not fully convinced about it and i think the "m" parameter needs to be calibrated as well.

I recommend using the fluent's implementation with critical shear rate using low values, in the order of 0.001 s^-1 and 0.01 s^-1, then confront with analytical results as you did.

Any further questions regarding to non-Newtonian fluids, you can PM me.
saoYT is offline   Reply With Quote

Old   September 26, 2018, 09:34
Default
  #9
Member
 
Liliana de Luca Xavier Augusto
Join Date: Feb 2013
Posts: 69
Rep Power: 13
liliana is on a distinguished road
Quote:
Originally Posted by saoYT View Post
Hello liliana!

I'm currently facing the same problem as you, working with Herschel-Bulkley fluids with ANSYS Fluent.

The Herschel-Bulkley rheological model (for n = 1, we have the Bingham model) has a discontinuity on its function, since we have a yield stress. So, Fluent implements a regularization model to overcome this discontinuity (documented in the user's guide), using a "critical shear rate", which means that for shear rate < critical shear rate, the fluid will behave as a Newtonian Fluid with high viscosity, and for shear rate > critical shear rate the fluid will behave as a Herschel-Bulkley fluid (or Bingham fluid, in your case).

The udf you are showing makes a different regularization for this problem, with the Papanastasiou Model, which depends on the "m" parameter. The literature recomends m = 1000s (LABSI, 2016, "Herschel-Bulkley fluid flow within a pipe by taking into account viscous dissipation"), however i'm not fully convinced about it and i think the "m" parameter needs to be calibrated as well.

I recommend using the fluent's implementation with critical shear rate using low values, in the order of 0.001 s^-1 and 0.01 s^-1, then confront with analytical results as you did.

Any further questions regarding to non-Newtonian fluids, you can PM me.
Hi! Thanks for the reply! I have tried the model implemented on Fluent already and I got the same result as I got with my UDF...
liliana is offline   Reply With Quote

Old   September 26, 2018, 09:51
Default
  #10
New Member
 
Join Date: Mar 2016
Posts: 6
Rep Power: 10
saoYT is on a distinguished road
Quote:
Originally Posted by liliana View Post
Hi! Thanks for the reply! I have tried the model implemented on Fluent already and I got the same result as I got with my UDF...
which values did you input at the critical shear rate?

and about the numerical details: which convergence criteria and number of iterations are you using? and where are you getting the velocity data in the domain (usually it's a point/line/plane where the flow is fully developed)?
saoYT is offline   Reply With Quote

Old   September 26, 2018, 09:54
Default
  #11
Member
 
Liliana de Luca Xavier Augusto
Join Date: Feb 2013
Posts: 69
Rep Power: 13
liliana is on a distinguished road
Quote:
Originally Posted by saoYT View Post
which values did you input at the critical shear rate?

and about the numerical details: which convergence criteria and number of iterations are you using? and where are you getting the velocity data in the domain (usually it's a point/line/plane where the flow is fully developed)?
I have used 0.1, 0.01, 1e-6, 1e-16... And the results were very very similar..

I am getting the velocity at x=0.045 m, the pipe has x=0.049m. I saw that the flow is fully developed (since I am using a pressure condition at inlet as well....).

I have disable the convergence criteria and I am monitoring the maximum velocity (and the field, and the profile...), when they are stable, I stop the simulation (around residuals 1e-8 or 1e-9).
liliana is offline   Reply With Quote

Old   September 26, 2018, 10:11
Default
  #12
New Member
 
Join Date: Mar 2016
Posts: 6
Rep Power: 10
saoYT is on a distinguished road
Quote:
Originally Posted by liliana View Post
I have used 0.1, 0.01, 1e-6, 1e-16... And the results were very very similar..

I am getting the velocity at x=0.045 m, the pipe has x=0.049m. I saw that the flow is fully developed (since I am using a pressure condition at inlet as well....).

I have disable the convergence criteria and I am monitoring the maximum velocity (and the field, and the profile...), when they are stable, I stop the simulation (around residuals 1e-8 or 1e-9).
ok, it seems fine.

give a look at this article, the author did a very similar case with fluent and it's well explained.

https://www.sciencedirect.com/scienc...92687514003677
saoYT is offline   Reply With Quote

Old   September 26, 2018, 10:17
Default
  #13
Member
 
Liliana de Luca Xavier Augusto
Join Date: Feb 2013
Posts: 69
Rep Power: 13
liliana is on a distinguished road
Quote:
Originally Posted by saoYT View Post
ok, it seems fine.

give a look at this article, the author did a very similar case with fluent and it's well explained.

https://www.sciencedirect.com/scienc...92687514003677
Thanks, I'll take a look!
liliana is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a UDF for fluid inlet velocity ameetks99 Fluent UDF and Scheme Programming 10 February 9, 2017 07:29
UDF for a viscoelastic fluid flow cliff Fluent UDF and Scheme Programming 1 December 21, 2014 16:04
How to choose the mean diameter value for dispersed fluid? creddy_trddc CFX 1 October 30, 2011 05:30
Velocity of Fluid @ different positions of Particle in DPM using UDF pmghadge FLUENT 1 June 16, 2009 20:11
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 10:11


All times are GMT -4. The time now is 09:35.