|
[Sponsors] |
May 27, 2016, 10:06 |
UDF for non-Newtonian fluid viscosity
|
#1 |
New Member
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 10 |
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 |
|
May 27, 2016, 10:13 |
|
#2 |
Senior Member
nm
Join Date: Mar 2013
Posts: 100
Rep Power: 13 |
whats the error you are getting?
|
|
May 27, 2016, 11:28 |
|
#3 |
New Member
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 10 |
AMG solver ERROR
|
|
May 31, 2016, 10:54 |
|
#4 |
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 10 |
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 |
|
May 31, 2016, 11:27 |
Need help for UDF generation
|
#5 |
New Member
Join Date: Jun 2013
Posts: 8
Rep Power: 12 |
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: 71
Rep Power: 10 |
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 k-w 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: 12 |
Quote:
|
||
May 31, 2016, 11:51 |
|
#8 | |
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 10 |
Quote:
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 |
||
May 31, 2016, 11:59 |
|
#9 | |
New Member
Join Date: Jun 2013
Posts: 8
Rep Power: 12 |
Quote:
|
||
May 31, 2016, 12:38 |
|
#10 |
New Member
Join Date: Jun 2013
Posts: 8
Rep Power: 12 |
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: 10 |
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. |
|
June 1, 2016, 04:13 |
|
#12 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
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: 10 |
Quote:
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 |
||
June 1, 2016, 10:19 |
|
#14 | |
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 10 |
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: 10 |
Quote:
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 |
||
June 2, 2016, 10:05 |
|
#16 |
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 10 |
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 |
|
June 3, 2016, 01:56 |
|
#17 | |
New Member
mohsen
Join Date: Jun 2015
Posts: 25
Rep Power: 10 |
Quote:
thanks and Best Regards |
||
May 10, 2018, 05:23 |
|
#18 |
New Member
danane fetta
Join Date: Mar 2018
Posts: 2
Rep Power: 0 |
pleeezz send me a udf bingham fluid
|
|
May 10, 2018, 13:46 |
|
#19 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
Please try to implement it yourself, and come here if you have problems.
|
|
|
|
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 |