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

Doubt about real x[ND_ND] declaration in FLUENT udf

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

Like Tree2Likes
  • 1 Post By flotus1
  • 1 Post By Zheng

Reply
 
LinkBack Thread Tools Display Modes
Old   March 19, 2013, 14:45
Default Doubt about real x[ND_ND] declaration in FLUENT udf
  #1
Member
 
Join Date: Jul 2012
Posts: 41
Rep Power: 4
Abhya is on a distinguished road
Hi,
we declare the position vector in a udf as
x[ND_ND];
my doubt is what is the data type (double? float?)of this x[0] variable .. if I'm using double precision solver??
and in single precision solver?

This seems to cause certain weird unexpected random kindoff results in the conditions of "IF else" statements in my udfs..plz replyy !
thnx in advance
Abhya is offline   Reply With Quote

Old   March 19, 2013, 17:49
Default
  #2
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,097
Rep Power: 19
flotus1 will become famous soon enoughflotus1 will become famous soon enough
I think the UDF manual covers this topic.

Variables declared as real are double if you are using the double precision solver.
If you dont trust the manual, declare x as double.
Abhya likes this.
flotus1 is offline   Reply With Quote

Old   March 20, 2013, 08:03
Default
  #3
New Member
 
Join Date: Feb 2013
Location: Australia
Posts: 6
Rep Power: 4
Zheng is on a distinguished road
u define it as real and fluent udf will automatically convert it to float in the single precison solver and double in double precision solver.
Abhya likes this.
Zheng is offline   Reply With Quote

Old   March 20, 2013, 09:38
Default
  #4
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,097
Rep Power: 19
flotus1 will become famous soon enoughflotus1 will become famous soon enough
Zheng, why do you keep repeating my answers?
flotus1 is offline   Reply With Quote

Old   March 20, 2013, 18:19
Default
  #5
New Member
 
Join Date: Feb 2013
Location: Australia
Posts: 6
Rep Power: 4
Zheng is on a distinguished road
Quote:
Originally Posted by flotus1 View Post
Zheng, why do you keep repeating my answers?
O I just noticed. I did not pay attention to ur answers at all.
Zheng is offline   Reply With Quote

Old   March 21, 2013, 01:21
Default
  #6
Member
 
Join Date: Jul 2012
Posts: 41
Rep Power: 4
Abhya is on a distinguished road
Quote:
Originally Posted by flotus1 View Post
I think the UDF manual covers this topic.

Variables declared as real are double if you are using the double precision solver.
If you don't trust the manual, declare x as double.
Hi thanks ..
I tried it .. but it gives an error "Segmentation Violation" in the "EXECUTE_ON_DEMAND" udf im using .. it involves the comparison of 2-different array elements at a time .. i tried declaring on array as a double and other as a real(double precision solver) .. however if i declare both as real it runs successfully..isn't this weird?
Abhya is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two questions on Fluent UDF Steven Fluent UDF and Scheme Programming 4 September 20, 2013 16:30
view factor yoollooz Fluent UDF and Scheme Programming 0 March 1, 2013 01:44
UDF issue MASOUD Fluent UDF and Scheme Programming 14 December 6, 2012 14:39
defining a term for a domain using DEFINE_ADJUST MASOUD Fluent UDF and Scheme Programming 1 September 24, 2010 05:08
UDF error from Windows to Linux manu FLUENT 3 January 10, 2008 05:02


All times are GMT -4. The time now is 20:45.