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

somebody help me!!(regarding udf)

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2003, 05:46
Default somebody help me!!(regarding udf)
  #1
guevara
Guest
 
Posts: n/a
I don't know wheather this form is correct or not. Can anyboby help me?

#include "udf.h"

#define PI 3.141579 #define I 36000 #define Jc 4400

DEFINE_SOURCE(thetamom_source, cell, thread, dS, eqn) {

real x[ND_ND];

real Rc, R, source1;

real Jz, B,y;

y=x[1];

Rc=sqrt(I/PI*Jc);

R=Rc*(1.+sqrt(x[0]/Rc));

if(y<=R)

{ C_CENTROID(x, cell, thread);

Jz = (2*I/PI*pow(R,4))*(pow(R,2)-pow(y,2));

B = I/PI*(y/pow(R,2)-(pow(y,3)/2*pow(R,4)));

source1= Jz*B;

if(y>R)

source1= 0;

dS[eqn]=0;

return source1;

}

- guevara

ccc, can you send me? if you can, i will appreciate it
  Reply With Quote

Old   March 4, 2003, 13:02
Default Re: somebody help me!!(regarding udf)
  #2
Murali
Guest
 
Posts: n/a
<font face = "courier new">some tips that were suggested to me while writing udfs are:

(1) the #define statements each better be in different lines

(2) do not ever try to cut a long stmt into parts and continue the trailing part in the next line. Write the full stmt in the same line

(3) do not use /* and */ for commenting huge chunks of code. Use them for commenting single lines

Other than these company tips, whatever you write is your code. U don't really have to by ultra-proficient in C to programme UDFs. A little application of mind with a lot of copy-paste from UDF manuals should take care of UDFs.

Hope this helps

Murali </font>
  Reply With Quote

Old   March 4, 2003, 21:41
Default Re: somebody help me!!(regarding udf)
  #3
ccc
Guest
 
Posts: n/a
hi, guevara: sorry, I am out for several days. I will send it to you and others who want it tonight and you might recieve it today or tomorrow due to the time difference.
  Reply With Quote

Old   March 5, 2003, 04:48
Default Re: somebody help me!!(regarding udf)
  #4
guevara
Guest
 
Posts: n/a
thanks ccc.
  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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


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