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

UDF for non-Newtonian fluid viscosity

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 27, 2016, 10:06
Default UDF for non-Newtonian fluid viscosity
  #1
New Member
 
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 10
moabdi is on a distinguished road
Hi every body
I have Written an UDF for non-Newtonian Fluid, but it doesn't work in both series and parallel fluent run.the code is:

#include "udf.h"
#include "math.h"
#include "sg_udms.h"
#include "sg.h"
#include "stdio.h"
#include "mem.h"
#include "dpm.h"
#include "surf.h"


DEFINE_PROPERTY(cell_viscosity,c,t)
{
#if !RP_NODE
real SR=C_STRAIN_RATE_MAG(c,t);
real n=0.70;
real k=0.29;
real YSR;
real PV=10.00;
real YP=6.00;
real EV;

YSR=YP/(k-PV);

if (SR<YSR)
EV=YP*((2*YSR-SR)/(YSR*YSR))+k*((2-n)+(n-1)*(SR/YSR));
else
EV=(YP/SR)+k*(exp((n-1)*log(SR/YSR)));
return EV;
#endif
}

it's my pleasure if some body could help me
BEST REGARDS
moabdi is offline   Reply With Quote

Old   May 27, 2016, 10:13
Default
  #2
Senior Member
 
nm
Join Date: Mar 2013
Posts: 100
Rep Power: 13
nvarma is on a distinguished road
whats the error you are getting?
nvarma is offline   Reply With Quote

Old   May 27, 2016, 11:28
Default
  #3
New Member
 
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 10
moabdi is on a distinguished road
AMG solver ERROR
moabdi is offline   Reply With Quote

Old   May 31, 2016, 10:54
Default
  #4
Member
 
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 10
bhargavbharathan is on a distinguished road
What non-newtonian model are you trying to write a udf for? Bingham? HB? Cross? Power law?

I have one written for HB with n=1.

Reply with more information.

-BB
bhargavbharathan is offline   Reply With Quote

Old   May 31, 2016, 11:27
Default Need help for UDF generation
  #5
New Member
 
Join Date: Jun 2013
Posts: 8
Rep Power: 12
msbhatti123 is on a distinguished road
Dear All,
I am trying to get formula's for sst kw equations. i found but so many. could you please help me upload formula which are common for use for sst kw model. I want UDF for inlet boundary conditions for wind flow which is fully turbulent. thanks in advance
msbhatti123 is offline   Reply With Quote

Old   May 31, 2016, 11:37
Default
  #6
Member
 
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 10
bhargavbharathan is on a distinguished road
Quote:
Originally Posted by msbhatti123 View Post
Dear All,
I am trying to get formula's for sst kw equations. i found but so many. could you please help me upload formula which are common for use for sst kw model. I want UDF for inlet boundary conditions for wind flow which is fully turbulent. thanks in advance
Hi,

It is straightforward to write a UDF for velocity inlet. Provide us more details on what you intend to give as the boundary condition i.e. what kind of velocity inlet condition you wish to specify. Then a simple udf can be written and hooked up.

As for the "sst kw", I'm assuming it means steady state k-w turbulence model? You can get the model details and equations from the ANSYS user manual.


-BB
bhargavbharathan is offline   Reply With Quote

Old   May 31, 2016, 11:40
Default
  #7
New Member
 
Join Date: Jun 2013
Posts: 8
Rep Power: 12
msbhatti123 is on a distinguished road
Quote:
Originally Posted by bhargavbharathan View Post
Hi,

It is straightforward to write a UDF for velocity inlet. Provide us more details on what you intend to give as the boundary condition i.e. what kind of velocity inlet condition you wish to specify. Then a simple udf can be written and hooked up.

As for the "sst kw", I'm assuming it means steady state k-w turbulence model? You can get the model details and equations from the ANSYS user manual.


-BB
thanks Bhargav, yes it is steady state. but there are so many things like production generation. if possible could you please upload formula which is normal in use. I am from chandigarh and if possible plz share your contact details if i need more help from you. thanks
msbhatti123 is offline   Reply With Quote

Old   May 31, 2016, 11:51
Default
  #8
Member
 
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 10
bhargavbharathan is on a distinguished road
Quote:
Originally Posted by msbhatti123 View Post
thanks Bhargav, yes it is steady state. but there are so many things like production generation. if possible could you please upload formula which is normal in use. I am from chandigarh and if possible plz share your contact details if i need more help from you. thanks
Hi,

Check out this link from CFD online:
http://www.cfd-online.com/Wiki/SST_k-omega_model

This is from the theory guide:
https://www.sharcnet.ca/Software/Flu...ug/node487.htm

-BB
bhargavbharathan is offline   Reply With Quote

Old   May 31, 2016, 11:59
Default
  #9
New Member
 
Join Date: Jun 2013
Posts: 8
Rep Power: 12
msbhatti123 is on a distinguished road
Quote:
Originally Posted by bhargavbharathan View Post
Hi,

Check out this link from CFD online:
http://www.cfd-online.com/Wiki/SST_k-omega_model

This is from the theory guide:
https://www.sharcnet.ca/Software/Flu...ug/node487.htm

-BB
Thanks for sharing but still there is one thing. as my wind profile is steady state and the given equations are with respect to time. but i just ignore them say differentiation thing.
msbhatti123 is offline   Reply With Quote

Old   May 31, 2016, 12:38
Default
  #10
New Member
 
Join Date: Jun 2013
Posts: 8
Rep Power: 12
msbhatti123 is on a distinguished road
Quote:
Originally Posted by msbhatti123 View Post
Thanks for sharing but still there is one thing. as my wind profile is steady state and the given equations are with respect to time. but i just ignore them say differentiation thing.
As i am using steady state situation. i can't use transient formula, because nothing is changing with time. i am keeping wind profile constant in whole domain. wind profile is changing only with height. but in formula differentiation is with respect to time. thanks . any help will be appreciated.
msbhatti123 is offline   Reply With Quote

Old   June 1, 2016, 02:26
Default
  #11
New Member
 
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 10
moabdi is on a distinguished road
Hi Bhargav Bharathan
I am trying to write HB(Herschel-Bulkley) for various n,K and Yield Point.
n,k and Yield Point will be change in every run.
moabdi is offline   Reply With Quote

Old   June 1, 2016, 04:13
Default
  #12
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
The original UDF from moabdi's opening post gives negative viscosities. That is why Fluent will give a solver error. Check if you made no mistake in typing the equations or constants.
pakk is offline   Reply With Quote

Old   June 1, 2016, 04:37
Default
  #13
New Member
 
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 10
moabdi is on a distinguished road
Quote:
Originally Posted by pakk View Post
The original UDF from moabdi's opening post gives negative viscosities. That is why Fluent will give a solver error. Check if you made no mistake in typing the equations or constants.
Hi pakk and thanks for your attention and trying to check the formula
you are right, negative viscosity caused be this term : k-PV
and must be replaced by PV-k

now, i ask if some body has the better formula for define Herschel-Bulkly non-Newtonian fluid model in UFD

thanks and Best Regards
moabdi is offline   Reply With Quote

Old   June 1, 2016, 10:19
Default
  #14
Member
 
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 10
bhargavbharathan is on a distinguished road
Quote:
Originally Posted by moabdi View Post
Hi Bhargav Bharathan
I am trying to write HB(Herschel-Bulkley) for various n,K and Yield Point.
n,k and Yield Point will be change in every run.
Hi,

When you say n, K, tau change n every run then I guess you mean they change for every new trial where you have a range of each values? I suggest you write journal files instead of UDFs, since you just want to change the material properties.

All you need to do is prepare the journal file then load it for each case.

-BB
bhargavbharathan is offline   Reply With Quote

Old   June 2, 2016, 01:21
Default
  #15
New Member
 
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 10
moabdi is on a distinguished road
Quote:
Originally Posted by bhargavbharathan View Post
Hi,

When you say n, K, tau change n every run then I guess you mean they change for every new trial where you have a range of each values? I suggest you write journal files instead of UDFs, since you just want to change the material properties.

All you need to do is prepare the journal file then load it for each case.

-BB
Hi
yes, i have one model that must be solved with 5 different non-Newtonian fluids, then compare the results, so, what is "journal files" ? and how could create or write a journal file? please, explain more
thanks and Best Regards
moabdi is offline   Reply With Quote

Old   June 2, 2016, 10:05
Default
  #16
Member
 
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 10
bhargavbharathan is on a distinguished road
Hi,

Read up on the internet about it, if you are having troubles I can send over my own journal file for this purpose. Although I must warn you the order of the commands in the journal could change depending on the exact setup you choose. Hence, even if you have my file or a reference from somewhere else always check line by line for errors before implementing.

https://www.sharcnet.ca/Software/Flu.../ug/node94.htm
http://www.cfd-online.com/Wiki/Fluen...TUI.29_Related

-BB
bhargavbharathan is offline   Reply With Quote

Old   June 3, 2016, 01:56
Default
  #17
New Member
 
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 10
moabdi is on a distinguished road
Quote:
Originally Posted by bhargavbharathan View Post
Hi,

Read up on the internet about it, if you are having troubles I can send over my own journal file for this purpose. Although I must warn you the order of the commands in the journal could change depending on the exact setup you choose. Hence, even if you have my file or a reference from somewhere else always check line by line for errors before implementing.

https://www.sharcnet.ca/Software/Flu.../ug/node94.htm
http://www.cfd-online.com/Wiki/Fluen...TUI.29_Related

-BB
Hi
thanks and Best Regards
moabdi is offline   Reply With Quote

Old   May 10, 2018, 05:23
Default
  #18
New Member
 
danane fetta
Join Date: Mar 2018
Posts: 2
Rep Power: 0
dananefetta is on a distinguished road
pleeezz send me a udf bingham fluid
dananefetta is offline   Reply With Quote

Old   May 10, 2018, 13:46
Default
  #19
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Please try to implement it yourself, and come here if you have problems.
pakk 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
Issue in simulation of open channel flow with high viscosity fluid soleymm1 STAR-CCM+ 2 December 3, 2017 01:44
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 06:20
Error in Two phase (condensation) modeling adilsyyed CFX 15 June 24, 2015 19:42
nonnewtonian fluid, effective viscosity RugbyGandalf OpenFOAM Running, Solving & CFD 0 August 5, 2011 19:49
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 09:11


All times are GMT -4. The time now is 23:52.