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

Error:surface reaction rate UDF in 2D porous media

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 14, 2016, 03:05
Smile Error:surface reaction rate UDF in 2D porous media
  #1
New Member
 
luwei
Join Date: Dec 2016
Posts: 2
Rep Power: 0
Ludaer is on a distinguished road
Hello everybody!
I'm using the DEFINE_SR_RATE to specify a surface reaction rate in2d porous media.However,once I calculcate the case,the error appeared as shown below:
Error: received a fatal signal (Segmentation fault).

#include"udf.h"
#define H2O 0
#define H2 1
#define C_S 2
#define CO 3
real k1_rate(real temp)
{
return
2000*exp(-32963/temp);
}
real k2_rate(real temp)
{
return
110*exp(-8958/temp);
}
real k3_rate(real temp)
{
return
201*exp(-11524/temp);
}
real reaction_rate(cell_t c, Thread *cthread,real mw[],real yi[])
{
real concenH2O = C_R(c,cthread)*yi[H2O]/mw[H2O]*C_P(c,cthread);
real concenH2 = C_R(c,cthread)*yi[H2]/mw[H2]*C_P(c,cthread);
return
k1_rate(C_T(c,cthread))*concenH2O/(1+k2_rate(C_T(c,cthread))*pow(concenH2,0.75)+ k3_rate(C_T(c,cthread))*concenH2O)*150;
}
DEFINE_SR_RATE(myrate,f,fthread,r,mw,yi,rr)
{
*rr =
reaction_rate(F_C0(f,fthread),THREAD_T0(fthread),m w,yi);
}
I already know the macro F_C0(f,fthread),THREAD_T0(fthread) are wrong ,how to modify it,thank you all attention.
Ludaer is offline   Reply With Quote

Old   December 15, 2016, 07:20
Default
  #2
Member
 
Howard
Join Date: Jun 2012
Posts: 43
Rep Power: 13
twcp0104 is on a distinguished road
In this sort of situation what I do is fill the code with markers:

Message("1");
Message("2");

If you put these all over, between every line of code, you'll have an idea of what part is giving you problems... In general, these segmentation fault deals have something to do with using a UDMI that has not been initialized in Fluent, or a variable that is being used but doesnt have a value yet, or an array that is not long enough.... the list goes on.
twcp0104 is offline   Reply With Quote

Old   December 15, 2016, 07:49
Default
  #3
New Member
 
luwei
Join Date: Dec 2016
Posts: 2
Rep Power: 0
Ludaer is on a distinguished road
Quote:
Originally Posted by twcp0104 View Post
In this sort of situation what I do is fill the code with markers:

Message("1");
Message("2");

If you put these all over, between every line of code, you'll have an idea of what part is giving you problems... In general, these segmentation fault deals have something to do with using a UDMI that has not been initialized in Fluent, or a variable that is being used but doesnt have a value yet, or an array that is not long enough.... the list goes on.
thank you,i have done as you say, i already know the macro F_C0(f,fthread),THREAD_T0(fthread) have problems, so i doubt the DEFINE_SR_RATE can't apply to the porous media zone
Ludaer is offline   Reply With Quote

Reply

Tags
porous cell zone, surface reaction rate

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 multiple reaction rate monababaei Fluent UDF and Scheme Programming 3 November 5, 2018 07:30
PaSR + infinite reaction rate in reactingFoam --> no reactions occurring tatu OpenFOAM Running, Solving & CFD 2 November 24, 2016 18:34
porous media reaction with inflow gas Yuting CFX 0 August 14, 2016 20:58
how to use UDF or method to define Boundary condition for Porous media in NLTE hitchenxue FLUENT 0 April 19, 2014 02:40
Parallel UDF for viscous resistance for porous media CfdMirco Fluent UDF and Scheme Programming 1 March 15, 2013 08:49


All times are GMT -4. The time now is 16:56.