|
[Sponsors] |
Error:surface reaction rate UDF in 2D porous media |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 14, 2016, 04:05 |
Error:surface reaction rate UDF in 2D porous media
|
#1 |
New Member
luwei
Join Date: Dec 2016
Posts: 2
Rep Power: 0 |
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. |
|
December 15, 2016, 08:20 |
|
#2 |
Member
Howard
Join Date: Jun 2012
Posts: 43
Rep Power: 14 |
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. |
|
December 15, 2016, 08:49 |
|
#3 | |
New Member
luwei
Join Date: Dec 2016
Posts: 2
Rep Power: 0 |
Quote:
|
||
Tags |
porous cell zone, surface reaction rate |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PaSR + infinite reaction rate in reactingFoam --> no reactions occurring | tatu | OpenFOAM Running, Solving & CFD | 3 | June 2, 2024 11:04 |
udf for multiple reaction rate | monababaei | Fluent UDF and Scheme Programming | 3 | November 5, 2018 08:30 |
porous media reaction with inflow gas | Yuting | CFX | 0 | August 14, 2016 21:58 |
how to use UDF or method to define Boundary condition for Porous media in NLTE | hitchenxue | FLUENT | 0 | April 19, 2014 03:40 |
Parallel UDF for viscous resistance for porous media | CfdMirco | Fluent UDF and Scheme Programming | 1 | March 15, 2013 09:49 |