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

Error in compliling UDF

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 20, 2019, 21:58
Default Error in compliling UDF
  #1
New Member
 
Rahul
Join Date: Jun 2019
Location: Pune
Posts: 23
Rep Power: 6
rahulmule797@gmail.com is on a distinguished road
I am trying to compile the UDF code as given below...I want to interpolate the property of argon at desired temperature. But after interpreting it shows error at last line of table definition.
*=>Error: Invalid Type Conversion float-> array 2 of double*
Please help me out...



DEFINE_PROPERTY(Argon_density, c,t)

{

double T;

double table[24][2]={ //table of computed density data for Argon at 1bar {5500,8.86E-02},

{6000,8.12E-02},{6500,7.49E-02},{7000,6.96E-02},{7500,6.49E-02},{8000,6.08E-02},

{8500,5.71E-02},{9000,5.38E-02},{9500,5.06E-02},{10000,4.77E-02},{10500,4.48E-02},

{11000,4.19E-02},{11500,3.90E-02},{12000,3.60E-02},{12500,3.30E-02},{13000,3.00E-02},

{13500,2.71E-02},{14000,2.45E-02},{14500,2.21E-02},{15000,2.01E-02},{15500,1.85E-02},

{16000,1.72E-02},{16500,1.62E-02},{17000,1.53E-02},{17500,1.47E-02},{18000,1.41E-02},

{18500,1.36E-02},{19000,1.31E-02},{19500,1.27E-02},{20000,1.23E-02},{20500,1.19E-02},

{21000,1.15E-02},{21500,1.11E-02},{22000,1.07E-02},{22500,1.03E-02},{23000,9.89E-03},

{23500,9.46E-03},{24000,9.02E-03},{24500,8.60E-03},{25000,8.19E-03},{25500,7.80E-03},


};

int n;

double x[2],y[2],rho;

T=C_T(c,t);

for(n = 0; n < TABLESIZE-1; n++){

if((T > table[n][0]) && (T <= table[n+1][0])){

x[0]=table[n][0];

x[1]=table[n][1];

y[0]=table[n+1][0];

y[1]=table[n+1][1];

rho=(y[1]-x[1])/(y[0]-x[0])*(T-x[0])+x[1];
}}

return rho
rahulmule797@gmail.com is offline   Reply With Quote

Old   August 21, 2019, 00:18
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
as far as I know standard libraries which are available in Fluent, are not suitable for 2D arrays
make 2 separated arrays
or make an object (which is tricky)

best regards
AlexanderZ is offline   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
udf for one dimensional linear motion based on force maccheese Fluent UDF and Scheme Programming 2 September 1, 2019 02:18
Save output of udf in another udf! JuanJoMex FLUENT 0 February 8, 2018 12:43
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


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