Compiled and Hooked UDF Surface Reaction but can't access it

  • Last Post 3 weeks ago
adleiva posted this 26 May 2020

Hello guys, I could really use your help.


I've developed an UDF for Surface Reaction. It is a photocatalytic surface reaction for the degradation of caffeine.

I bet the code has no errors, and it's correctly compiled and hooked on my case (no error messages of any kind). 


BUT, when I try to define my boundary condition, my UDF reaction doesn´t appear anywhere (fluid domain, reacting walls, mixture... just nothing). All I find is the default reaction called ''mechanism-1''.


I would really like to know if I'm missing some aspects (model requirements, conditions, etc ) or if you know something that might help me to solve it.


Thanks in advance!

Order By: Standard | Newest | Votes
adleiva posted this 27 May 2020

Also I´m using. 
Discrete Ordinate Radiation Model
Kappa epsilon turbulent model
I introduce a general equation (need to) 
2 C8H10N4O2 + 19 O2 -> 16 CO2 + 10 H2O + 4 N2
I made a mixture material out of the species involved in the reaction and they are all bulk species. 

This is my UDF:

#include "udf.h"

#define FACTOR_ONE 1e-4
real A[ND_ND];
real k_app(real inten)

#define CAF 0

real reaction_rate(cell_t c,Thread *cthread,real mw[],real yi[])

 real concenCAF = C_R(c,cthread)*yi[CAF]/mw[CAF];

 return concenCAF;



*rr = reaction_rate(F_C0(f,fthread),THREAD_T0(fthread),mw,yi)*k_app(BOUNDARY_HEAT_FLUX(f,fthread)/NV_MAG(A));

abenhadj posted this 27 May 2020

it should be hooked under function hooks.

Best regards, Amine

adleiva posted this 3 weeks ago

Thank you, Amine

It is in deed hooked under function hooks.

But I would like to know how to apply it on specific reaction walls. For example, when I go to the Species Tab, then I check the Reaction box, it only displays the default reaction, and not the UDF one.

I really hope you could guide me, please

Thank you,