|
[Sponsors] |
Data Structure in UDF, esp species transport model |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 8, 2015, 22:42 |
Data Structure in UDF, esp species transport model
|
#1 |
New Member
Lei Zhao
Join Date: Sep 2015
Posts: 12
Rep Power: 11 |
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? |
|
October 8, 2015, 22:48 |
|
#2 |
New Member
Lei Zhao
Join Date: Sep 2015
Posts: 12
Rep Power: 11 |
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" |
|
October 9, 2015, 00:25 |
|
#3 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
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. |
|
October 9, 2015, 15:14 |
|
#4 | |
New Member
Lei Zhao
Join Date: Sep 2015
Posts: 12
Rep Power: 11 |
Quote:
Can you help me fix this? |
||
October 9, 2015, 22:44 |
|
#5 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
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.
|
|
April 10, 2018, 02:45 |
Structure reference error
|
#6 |
New Member
Renika Baruah
Join Date: Apr 2018
Posts: 1
Rep Power: 0 |
Dear all
I am facing the same problem while working with multiple reactions. Has someone solve the problem?? |
|
|
|
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 |