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

How to fix problem form Interpreted UDFs

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 25, 2015, 03:12
Default How to fix problem form Interpreted UDFs
  #1
New Member
 
Piyanat
Join Date: Nov 2015
Posts: 9
Rep Power: 11
oTopero is on a distinguished road
when i'm interpreted code.c. it show a massage error about line 15: structure reference not implemented. how to fix it
thank for answer

i hope someone can help me for search the answer

this is code



#include "udf.h"

DEFINE_HET_RXN_RATE(reaction1,cell,thread,hr,mw,yi ,rr,rr_t)
{
real *stoich_reactant = hr->stoich_reactant;

int gas_index = 0;
int cat_index = 1;
/* int fd_index = 2; */
real R = 8.314; /* Pa.m^3/(K.kgmol) Gas Constant*/
real ca; /* FD - Feed in gas phase index 4*/
real cb; /* MD - Middle Distillates index 3 */
real cd; /* Nap - Naphtha index 2 */
real ce; /* Gas - C1-C3 index 1 */

/* Thread *liq = THREAD_SUB_THREAD(thread, fd_index); */
Thread *gas = THREAD_SUB_THREAD(thread, gas_index);
Thread *cat = THREAD_SUB_THREAD(thread, cat_index);

real k1 = 550.*exp(3.609e3/(R*345.));
real void_g = C_VOF(cell,gas);
/* real k2 = 4.6868*10e17*exp(-5.7755*10e4/(R*C_T(cell,gas)));
real k3 = 1.3508*10e14*exp(-4.9559*10e4/(R*C_T(cell,gas)));
real k4 = 4.4232*10e12*exp(-4.4285*10e4/(R*C_T(cell,gas)));
real k5 = 1.2094*10e13*exp(-4.5902*10e4/(R*C_T(cell,gas)));
real k6 = 85.1715*exp(-1.1627*10e4/(R*C_T(cell,gas))); */


/* if(Data_Valid_P())
{ */
ce = C_R(cell,gas) * yi[0][3] / mw[0][3];
cd = C_R(cell,gas) * yi[0][2] / mw[0][2];
cb = C_R(cell,gas) * yi[0][1] / mw[0][1];
ca = C_R(cell,gas) * yi[0][0] / mw[0][0];

*rr = k1*ca*cb*(1.-void_g) ;
/* } */
}
oTopero is offline   Reply With Quote

Old   November 25, 2015, 05:06
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
From the Fluent Help:

Quote:
Originally Posted by Customization_Manual_1.4.3
The major difference between interpreted and compiled UDFs is that interpreted UDFs cannot access ANSYS Fluent solver data using direct structure references; they can only indirectly access data through the use of ANSYS Fluent-supplied macros.
The code in line 4 is trying to access Fluent solver data using a direct structure reference. As the quote above shows, this can not be done with interpreted functions.

Solution: compile.
pakk is offline   Reply With Quote

Old   November 26, 2015, 05:08
Default
  #3
New Member
 
Piyanat
Join Date: Nov 2015
Posts: 9
Rep Power: 11
oTopero is on a distinguished road
Quote:
Originally Posted by pakk View Post
From the Fluent Help:


The code in line 4 is trying to access Fluent solver data using a direct structure reference. As the quote above shows, this can not be done with interpreted functions.

Solution: compile.
i used both interpreted and compile function.there show error both
oTopero 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
Problem interpreted Reaction Code oTopero FLUENT 11 November 24, 2015 07:25
Interesting new problem/ trying to fix contacts using a porous zone A.Jalal FLUENT 0 September 24, 2015 16:40
Problem exporting line bodies form Design Modeler to Mesh Editor&Fluent Rockda ANSYS Meshing & Geometry 0 May 26, 2011 12:03
error in interpreted udf's for two macro Asghari FLUENT 0 August 7, 2006 03:10
entropy fix for Riemann problem vivek kumar Main CFD Forum 3 August 31, 2005 08:47


All times are GMT -4. The time now is 22:18.