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

Udf Please help :(

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 23, 2020, 03:11
Default Udf Please help :(
  #1
New Member
 
kedy6lsy
Join Date: Oct 2019
Posts: 10
Rep Power: 6
kedy6lsy is on a distinguished road
Hi all, i am trying to code a udf for calculating the diffusion coefficient of each species for a non-unity lewis number

The code below is calculating the diffusion coefficient for the methane species, the code is suggested from the udf manual, but
I'm having error as fluent say :"Error: C:/Users/LEONGS~1/AppData/Local/Temp/LewisNumber.c.14616.3.c: line 19: structure reference not implemented"

Same error is also shown when i put original code from the udf manual

#include "udf.h"

/*** Non-unity Lewis Number UDF ***/

#define Le_CH4 0.97

DEFINE_PROPERTY(CH4_Diff,c,t)
{
real ktc; //thermal conductivity
real rho; //Density
real Cp; //Viscosity
real Diff; //Mass Diffusion Coefficient

int i; //Species Index
Material *sp; //Species Pointer
Property *prop; //Pointer to property array

mixture_species_loop(THREAD_MATERIAL(t),sp,i)
{
prop = (MATERIAL_PROPERTY(sp)); //
ktc = generic_property(c,t,prop,PROP_ktc,C_T(c,t)); //return ktc of species i
rho = generic_property(c,t,prop,PROP_rho,C_T(c,t)); //return rho of species i
Cp = generic_property(c,t,prop,PROP_Cp,C_T(c,t)); //return Cp of species i

Diff = Le_CH4*rho*Cp/ktc;
}
return Diff;
}
kedy6lsy is offline   Reply With Quote

Old   February 23, 2020, 03:34
Default Compilation
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
You most likely are trying to interpret it. That won't work. You ought to compile it.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   February 23, 2020, 03:36
Default
  #3
New Member
 
kedy6lsy
Join Date: Oct 2019
Posts: 10
Rep Power: 6
kedy6lsy is on a distinguished road
how can i do that?
kedy6lsy is offline   Reply With Quote

Old   February 23, 2020, 06:14
Default VS or VC++
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
Since you are using Windows, you need to install VS or VC++ or MS Build Tools with C++ compiler.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   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
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 08:43.