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

interpreting of UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 2, 2014, 00:03
Default interpreting of UDF
  #1
Member
 
sarah
Join Date: Aug 2010
Posts: 42
Rep Power: 15
sarah l is on a distinguished road
Hi folk,
I have faced a strange problem!
I am supposed to simulate a porous medium with three different porosities so I have written 3 UDFs. first I run for the smallest porosity and I got reasonable result and then I run for the biggest porosity I got non reasonable result! since it is obvious increasing porosity causes to increase many parameters. also while I run without udf I get reasonable results!
I guess this problem is related to interpretation of udf!
I would be grateful if you help me to solve that!

thank you in advance
Sarah
sarah l is offline   Reply With Quote

Old   August 2, 2014, 06:53
Default
  #2
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
Hi Sarah,

Why do you use 3 different UDFs for different porosities? If you use the same porosity method, it's just adjusting some parameters right?

If you use the same underlying porosity model, I'd be surprised if the interpretation causes the problem - much more likely some error in the parameters.

Is there any particular reason you are not compiling the udfs by the way?

Best,
Cees
CeesH is offline   Reply With Quote

Old   August 2, 2014, 09:10
Default
  #3
Member
 
sarah
Join Date: Aug 2010
Posts: 42
Rep Power: 15
sarah l is on a distinguished road
Dear Cees,
first thank you for your swift response!
well, let me explain more; I have written many udfs for heat source, C1,C2, Heat transfer coef,..... and also for porosity profile like this:
DEFINE_PROFILE(porosity,t,i)
{
real x[ND_ND];
real y;
real r;
cell_t c;
begin_c_loop(c,t)
{
C_CENTROID(x,c,t);
y=x[1];
r=sqrt(pow(x[0],2)+pow(y,2)); /*radius of cylinder*/

if ((r>=1.) && (r<=1.425))
{
F_PROFILE(c,t,i)=0.36*(1.+1.05*exp(-100.*(r-1.)/0.06));
}
if ((r>=1.425) && (r<=1.85))
{
F_PROFILE(c,t,i)=0.36*(1.+1.05*exp(-100.*(1.85-r)/0.06));
}
}
end_c_loop(c,t)
}
as you observe here 0.36 is the value of bulk porosity. you better know that C1 and C2 are functions of porosity so they are related to bulk porosity too. I want to go over on the porosity effect on my case. there are three bulk porosity selected for that ;0.36, 0.39 and 0.43.
according to theory and assumption that were employed for doing simulation , by increasing porosity, Temp increases and .... for porosity of 0.36 and 0.39 I get reasonable results but for porosity of 0.43 I get terrible results! I should remark I did it before by using FLUENT 6.3.26 without any problem (2D simulation) but now i use ansys fluent 14.5 and Microsoft visual 2012 to do 3D simulation. I even tried for other porosities like 0.38999 and 0.391 and I got non reasonable reults you know that the result of them should be near to porosity of 0.39 but.. I am so confused
I forgot to say I don't compile udfs I interpret them.
sorry for my long story
your sincerely
Sarah
sarah l is offline   Reply With Quote

Old   August 2, 2014, 11:04
Default
  #4
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
Hello Sarah,

I do not think that in this case interpreting UDFs should be the issue. Of course, the simple way to check that would be to run a compiled version of them as well and see if that does work. Are you not compiling because of the win64/FLUENT 14 compilation issue? If upgrading to v15 is not an option, try the manual on compiling under win64 environments and see if you can get that to run.

But to come back at the issue, i'd be highly suprised if compilation was the issue.
Did you try running the same 2D geometry as you did in FLUENT6, but now with FLUENT14.5? If not, see if you do get the 2D case to run in your new version of FLUENT. If that does work correctly, then the most likely problem in my opinion would be a mesh issue with the 3d case; maybe some refinement is required.
CeesH is offline   Reply With Quote

Old   August 2, 2014, 11:46
Default
  #5
Member
 
sarah
Join Date: Aug 2010
Posts: 42
Rep Power: 15
sarah l is on a distinguished road
Hi Cees,
I have never used compilation option ever! but as you say it maybe the best way to investigate the real cause of the problem so I'll try it . I use ansys fluent 14.5 on windows 8 (64bit) is there any problem to run compiled version with that?
I tried the same 2D geometry in fluent 14.5 and I got that terrible results

I told you before that my results from prosities of 0.36 and 0.39 are pretty good but for others not! as well as while I run my case without using udf I get reasonable results so it is not more probably related to mesh.
If you want I can give you my case file with udf and mesh to observe them.
I appreciate your consideration .
Yours sincerely
Sarah
sarah l is offline   Reply With Quote

Old   August 2, 2014, 14:17
Default
  #6
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
Hi Sarah,

There are indeed some problems compiling in FLUENT under windows7 / 8; there are some guidelines here: Compiling UDF in windows 7

Ok, good that you tried your 2D case in FLUENT 14.5 as well, that makes it a bit more puzzeling. Of course even if a mesh works properly under condition A, it may not be sufficiently refined under condition B - so that the UDF works for one case with this mesh does not automatically mean it does for any other porosity value. But if things worked under FLUENT 6 and not anymore, that is a bit weird to me...
CeesH is offline   Reply With Quote

Old   August 2, 2014, 14:56
Default
  #7
Member
 
sarah
Join Date: Aug 2010
Posts: 42
Rep Power: 15
sarah l is on a distinguished road
Hi Cees,
I should confess that I have seen a lot of strange things since I started using ansys fluent 14.5 like ; for 2d geometry I couldn't use non equilibrium model in porous zone and I got this error :"2-4 pair has some non-overlapping cells" 2 and 4 are solid and gas zones. or even I couldn't interpret all of my udfs for instance while I define udf for porosity profile then I couldn't define udf for energy source coz I get this error during calculation ; Error: Internal error at line 1020 in file '..\..\src\profile.c'.
Too many profiles

Error Object: #f

of course you are right about mesh , my reason was funny I just made an inane remark about that . Plz apologize me . I'll follow all of your directions and I hope I can solve my peoblem.
by the way I deeply wished you observe my case .
Best Regards
sarah l is offline   Reply With Quote

Old   August 4, 2014, 13:10
Default
  #8
Member
 
sarah
Join Date: Aug 2010
Posts: 42
Rep Power: 15
sarah l is on a distinguished road
Dear Cess,
sorry to bother you again I tried it with finer mesh but this problem still remains. oh there is some thing that is so bizarre to me ; I told you i got reasonable results just for porosity of 0.36 and 0.39 . so I tried to edit the udf of porosity of 0.36 and I replaced one ONLY one of 0.36s to 0.36999 and then I interpreted udf and run case and I got awful results for instance for porosity of 0.36 ,outlet Temp =1340k but when I edited the udf and just changed one of 0.36s to 0.36999 the result shows outlet Temp = 800!!!
do you by the chance have any idea about that ?
I haven't tried to compile the udf yet since I have Microsoft visual 2012 that doesn't have the special command prompt . I saw the website that you introduced to me so I want to install VS Express 2010 but i was wondering it works on windows 8 correctly .
I hope compiling works but if it doesn't work should I reinstall ansys software? coz I think maybe setting of fluent is right just for 0.36 and 0.39.

I really sorry to disturb you again.

Best Regards
Sarah
sarah l is offline   Reply With Quote

Old   August 6, 2014, 04:18
Default
  #9
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
Hi Sarah,

That sounds weird indeed..
You don't have to reinstall ansys software; but I have to say I don't know if it all works under windows 8. I run under 7 and there it goes well..

Best,
Cees
CeesH 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
the DEFINE_MASS_TRANSFER is only a interpreting udf IN ANSYS 14.0 fangdian Fluent UDF and Scheme Programming 7 April 19, 2016 03:53
syntax error while interpreting the UDF rohit chothave Fluent UDF and Scheme Programming 2 July 13, 2013 11:09
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 06:43
Problem with interpreting UDF Boris Kloser Fluent UDF and Scheme Programming 1 December 29, 2009 23:48
parse error with interpreting UDF ivanbuz Fluent UDF and Scheme Programming 2 August 13, 2009 18:29


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