
[Sponsors] 
May 27, 2016, 10:06 
UDF for nonNewtonian fluid viscosity

#1 
New Member
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 4 
Hi every body
I have Written an UDF for nonNewtonian 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/(kPV); if (SR<YSR) EV=YP*((2*YSRSR)/(YSR*YSR))+k*((2n)+(n1)*(SR/YSR)); else EV=(YP/SR)+k*(exp((n1)*log(SR/YSR))); return EV; #endif } it's my pleasure if some body could help me BEST REGARDS 

May 27, 2016, 10:13 

#2 
Member
nm
Join Date: Mar 2013
Posts: 81
Rep Power: 6 
whats the error you are getting?


May 27, 2016, 11:28 

#3 
New Member
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 4 
AMG solver ERROR


May 31, 2016, 10:54 

#4 
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 56
Rep Power: 4 
What nonnewtonian 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 

May 31, 2016, 11:27 
Need help for UDF generation

#5 
New Member
Join Date: Jun 2013
Posts: 8
Rep Power: 6 
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 

May 31, 2016, 11:37 

#6  
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 56
Rep Power: 4 
Quote:
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 kw turbulence model? You can get the model details and equations from the ANSYS user manual. BB 

May 31, 2016, 11:40 

#7  
New Member
Join Date: Jun 2013
Posts: 8
Rep Power: 6 
Quote:


May 31, 2016, 11:51 

#8  
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 56
Rep Power: 4 
Quote:
Check out this link from CFD online: http://www.cfdonline.com/Wiki/SST_komega_model This is from the theory guide: https://www.sharcnet.ca/Software/Flu...ug/node487.htm BB 

May 31, 2016, 11:59 

#9  
New Member
Join Date: Jun 2013
Posts: 8
Rep Power: 6 
Quote:


May 31, 2016, 12:38 

#10 
New Member
Join Date: Jun 2013
Posts: 8
Rep Power: 6 
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.


June 1, 2016, 02:26 

#11 
New Member
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 4 
Hi Bhargav Bharathan
I am trying to write HB(HerschelBulkley) for various n,K and Yield Point. n,k and Yield Point will be change in every run. 

June 1, 2016, 04:13 

#12 
Senior Member
Join Date: Nov 2013
Posts: 1,104
Rep Power: 15 
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.


June 1, 2016, 04:37 

#13  
New Member
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 4 
Quote:
you are right, negative viscosity caused be this term : kPV and must be replaced by PVk now, i ask if some body has the better formula for define HerschelBulkly nonNewtonian fluid model in UFD thanks and Best Regards 

June 1, 2016, 10:19 

#14  
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 56
Rep Power: 4 
Quote:
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 

June 2, 2016, 01:21 

#15  
New Member
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 4 
Quote:
yes, i have one model that must be solved with 5 different nonNewtonian 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 

June 2, 2016, 10:05 

#16 
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 56
Rep Power: 4 
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.cfdonline.com/Wiki/Fluen...TUI.29_Related BB 

June 3, 2016, 01:56 

#17  
New Member
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 4 
Quote:
thanks and Best Regards 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Wrong flow in ratating domain problem  Sanyo  CFX  17  August 15, 2015 06:20 
Issue in simulation of open channel flow with high viscosity fluid  soleymm1  STARCCM+  0  July 20, 2015 12:42 
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 