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

Data Structure in UDF, esp species transport model

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 8, 2015, 22:42
Default Data Structure in UDF, esp species transport model
  #1
New Member
 
Lei Zhao
Join Date: Sep 2015
Posts: 12
Rep Power: 11
leizhao512 is on a distinguished road
Hi, everyone, I am now simulating a reacting flow and need to write my own reaction models(DEFINE_VR_RATE). This is my first time to write UDF and I was kinda struggled. The followed is my UDF:
DEFINE_VR_RATE(Reaction_Rate, c, t, r, mw, yi, rate, rr_t)
{
real qac, kac, kox, x, sac, sm;
qac = 10.0;
kac = 0.001;
kox = 0.0001;
sac = C_R(c, t)*yi[r->reactant[0]] / mw[r->reactant[0]];
x = C_R(c, t)*yi[r->product[1]] / mw[r->product[1]];
sm = C_R(c, t)*yi[r->reactant[1]] / mw[r->reactant[0]];
*rate = qac*x*sac / (kac + sac)*sm / (kox + sm);
*rr_t = *rate;
}

However, when I tried to interpret this UDF, Fluent reported "structure reference not implemented" at "sac = C_R(c, t)*yi[r->reactant[0]] / mw[r->reactant[0]];"

Can anyone explain the variable of "yi" to me? Or is there any resource that talks about the variable structures in Fluent?
leizhao512 is offline   Reply With Quote

Old   October 8, 2015, 22:48
Angry
  #2
New Member
 
Lei Zhao
Join Date: Sep 2015
Posts: 12
Rep Power: 11
leizhao512 is on a distinguished road
I also tried to use the muti-reactions statement from the UDF tutorial:
"if (!strcmp(r->name, "reaction-1"))"
Fluent also reports "Structure reference not implemented"
leizhao512 is offline   Reply With Quote

Old   October 9, 2015, 00:25
Default
  #3
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
The UDF manual explains the arguments for each macro; specifically, yi is the pointer to array of the species mass fractions.

You will probably need to compile this UDF instead of interpreting.
`e` is offline   Reply With Quote

Old   October 9, 2015, 15:14
Default
  #4
New Member
 
Lei Zhao
Join Date: Sep 2015
Posts: 12
Rep Power: 11
leizhao512 is on a distinguished road
Quote:
Originally Posted by `e` View Post
The UDF manual explains the arguments for each macro; specifically, yi is the pointer to array of the species mass fractions.

You will probably need to compile this UDF instead of interpreting.
Thank you, I tried to compile the UDF. However, it said "nmake is not recognized as an internal or external command". I followed the instruction on http://www.cfd-online.com/Wiki/Fluen...ows_7_64bit.3F. It worked on one of my computers. However, when I did the same thing to my new computer, it gave me another weird error:"fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory"

Can you help me fix this?
leizhao512 is offline   Reply With Quote

Old   October 9, 2015, 22:44
Default
  #5
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Sounds like you're having troubles with a Windows compiler. I recommend installing Microsoft Visual Studio Express for Windows and ensure it's compatible with your Fluent version.
`e` is offline   Reply With Quote

Old   April 10, 2018, 02:45
Default Structure reference error
  #6
New Member
 
Renika Baruah
Join Date: Apr 2018
Posts: 1
Rep Power: 0
renika14 is on a distinguished road
Dear all

I am facing the same problem while working with multiple reactions. Has someone solve the problem??
renika14 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
Fluent species transport model lakshmi.bala FLUENT 23 November 2, 2022 02:42
confused with the coupled VOF and species transport model yfling27 FLUENT 0 November 30, 2012 03:18
Eulerian Multifase model with species transport Valeria FLUENT 0 July 19, 2008 17:48
Species Transport Model Sam FLUENT 0 November 12, 2005 22:42
DPM vs Species transport model osh FLUENT 0 August 19, 2005 23:15


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