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

UDF fatal error

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 19, 2005, 15:56
Default UDF fatal error
  #1
Srivatsan V. Rajagopalan
Guest
 
Posts: n/a
Hello all!

I work with gas particle two phase supersonic flow in nozzle. I wrote a UDF to change the drag coefficient correlation that fluent uses to calculate the drag force on the particles. I could successfully interpret it in Fluent solver, but when I hook it in to Fluent, I get following error. ************************************************** ********** Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: () ************************************************** ********** Can someone pls tell me what is the reason for this error?

This is the udf I have written.... ************************************************** ********** #include "udf.h" #include "mem.h" #define vis 1.663e-05 #define R 296.8 #define g 1.398 DEFINE_DPM_DRAG(test,Re,p) { //Variable Definitions// real a, b, d, mp, rhop, tp, dp, vp, u, v, w, cd, fd; //Defining particle variables real tg; real vg; cell_t c; Thread *t; dp = P_DIAM(p); tp = P_T(p); rhop = P_RHO(p); tg = C_T(c,t); u = C_U(c,t); v = C_V(c,t); w = C_W(c,t); vg = sqrt(u*u+v*v+w*w); vp = sqrt(pow(P_VEL(p)[0],2)+pow(P_VEL(p)[1],2)+pow(P_VEL(p)[2],2)); mp = (vg-vp)/sqrt(g*R*tg); a = (4.33+((3.65-1.53*(tp/tg))/(1+0.353*(tp/tg)))); b = 0.247*sqrt(2/g)*(Re/mp); d = (4.5+0.38*(0.03*Re+0.48*sqrt(Re))/(1+0.03*Re+0.48*sqrt(Re))); //Main Formula Calculation// cd = (24/(Re+sqrt(g/2)*mp*a*exp(-b)))+exp(-0.5*mp/sqrt(Re))*d+0.1*pow(mp,2)+0.2*pow(mp,8)+0.6*sqrt(g/2)*mp*(1-exp(-mp/Re)); fd = (18*vis*cd*Re)/(rhop*dp*dp*24); return(fd); } ************************************************** **********
  Reply With Quote

Old   September 19, 2005, 16:29
Default Re: UDF fatal error
  #2
Podila
Guest
 
Posts: n/a
Return Kgl and not Fd. Read manual carefully. In order to customise the drag force u have to return the momentum transfer term and not fd. The UDF u have coded is not appropriate as far as my understanding says..let me now if u have difficulty in understanding this concept.

The drag coefficient is easy to customise and in our lab my fellow colleages* and myself have worked with it. I am sorry we cannot share the codes as they are confidential till we publish them.

But as I said the u have to return Kgl and work the units carefully.

* Names cannot be disclosed due to lack of consent and confidentiality reasons.

  Reply With Quote

Old   September 19, 2005, 16:40
Default Re: UDF fatal error
  #3
Alec Eiffel
Guest
 
Posts: n/a
Try compiling the UDF rather than interpreting. Due to the limitations of interpreting there is a lot of problems using DPM macros and trying to interpret them
  Reply With Quote

Old   October 2, 2005, 17:45
Default Re: UDF fatal error
  #4
pUl|
Guest
 
Posts: n/a
I think the return function is correct in your case. Since you are using the DPM approach, you are expected to return 'fd' as clearly stated in:

http://www.fluentusers.com/fluent/do...efine-dpm-drag

As Alec has suggested, try compiling the UDF instead of interpreting it.
  Reply With Quote

Old   October 2, 2005, 19:06
Default Re: UDF fatal error
  #5
Srivatsan V. R.
Guest
 
Posts: n/a
Yeah! Infact! It worked well when I compiled the code...It was surprising....how does it make difference?
  Reply With Quote

Old   October 2, 2005, 19:23
Default Re: UDF fatal error
  #6
pUl|
Guest
 
Posts: n/a
A very quick answer to that would be the following excerpt from the Fluent manual:

"... DEFINE_DPM_DRAG is called at every particle time step in FLUENT, and requires a significant amount of CPU time to execute. For this reason, the UDF should be executed as a compiled UDF..."

This is again clearly stated here: http://www.fluentusers.com/fluent/do...efine-dpm-drag

A UDF example that uses the DEFINE_DPM_DRAG macro to computing particle drag coefficient using the curve as suggested by R. Clift, J. R. Grace and M.E. Weber "Bubbles, Drops, and Particles" (1978) is also given in the same page.

Really, answers to most general questions are provided in the manual. Fluent is rapidly improving.
  Reply With Quote

Old   October 3, 2005, 13:43
Default Re: UDF fatal error
  #7
Srivatsan V. R.
Guest
 
Posts: n/a
Yeah I saw the same thing in Manual. But I encountered an error saying "UNDECLARED VARIABLE: P_CELL: LINE 15"...It is something like a syntax error or otehr minor error. But when the same code, when compiled gave a clean chit to my UDF....Anyways I am happy now...

  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Building OpenFOAM1.7.0 from source ata OpenFOAM Installation 46 March 6, 2022 14:21
polynomial thermophysical properties II sebastian OpenFOAM Running, Solving & CFD 54 November 21, 2019 08:12
[OpenFOAM] Native ParaView Reader Bugs tj22 ParaView 270 January 4, 2016 12:39
OpenFOAM install on Ubuntu Natty 11.04 bkubicek OpenFOAM 13 May 26, 2011 06:48
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found piprus OpenFOAM Installation 22 February 25, 2010 14:43


All times are GMT -4. The time now is 07:53.