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

what's wrong with my UDF???

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 14, 2006, 21:17
Default what's wrong with my UDF???
  #1
lk zhu
Guest
 
Posts: n/a
Hi,everyone! I want to use VOF model and add a energy source in water.the sources should be added at position of the free surface using UDF.IN order to capture the free surface, i use the macro of C_VOF(The free surface cross all the cell where the volume fraction is different from 0 or 1).But things go contrary to my wishes, it can't run well .Can anybody help me to solove this problem? the udf and error messeges are as follows.

Thanks in advance

#include "udf.h" DEFINE_SOURCE(cell_heat_source,cell,thread,dS,eqn) {

real source;

C_VOF(cell,thread);

if(C_VOF(cell,thread)<1&&C_VOF(cell,thread)>0) {

source=25000;

dS[eqn]=0; }

else

source=dS[eqn]=0;

return source; }

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: ()

  Reply With Quote

Old   June 15, 2006, 03:20
Default Re: what's wrong with my UDF???
  #2
rom
Guest
 
Posts: n/a
If you hook this udf to the mixture fluent will bug out because it does not know which volume fraction do you want to access. There are at least 2 phases which are both part of the mixture, so you will have to supply aditional informations and tell fluent which phase you want to access.
This is done by using the corresponding sub thread for the phase. Assuming your primary phase is water, then correct udf will look like this:


#include "udf.h"

DEFINE_SOURCE(cell_heat_source,cell,mixture_thread ,dS,eqn)
{
real source;
int phase_domain_index = 0; /* primary phase index is 0 */
Thread *water_thread = THREAD_SUB_THREAD(mixture_thread,phase_domain_inde x);

if(C_VOF(cell,water_thread)<1&&C_VOF(cell,water_th read)>0)
{
source=25000;
dS[eqn]=0;
}
else
source=dS[eqn]=0;

return source;
}

Good luck, RoM
  Reply With Quote

Old   June 16, 2006, 03:52
Default Re: what's wrong with my UDF???
  #3
lk zhu
Guest
 
Posts: n/a
Thanx RoM for your reply ! I have try it in 3D and it worked very well.
  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
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 07:43
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 12:29
what's wrong with the UDF major FLUENT 6 March 3, 2005 07:39
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03


All times are GMT -4. The time now is 03:00.