|
[Sponsors] |
May 23, 2011, 12:13 |
How to realize the desorption by using UDF?
|
#1 |
New Member
Liu Lang
Join Date: May 2011
Posts: 1
Rep Power: 0 |
Dear all,
Here is my problem, I hope to realize the gas desorption by using UDF and code as follows: DEFINE_SOURCE(CH4_mass_source, cell, thread, dS, eqn) /* defining the mass source ( the ch4 source)*/ { cell_t c; real source, p, p1; real time_step=CURRENT_TIMESTEP; int time_steps=RP_Get_Integer("time-step"); if(time_steps>1) begin_c_loop(c,thread) { p=C_P(c,thread); p1=C_P_M1(c,thread); if (p>0 && p<p1) { source=(3.7*p1/(1570000+p1)-3.7*p/(1570000+p))/time_step; /* The Langmuir formula*/ } else { source=0; } return source; end_c_loop(c,thread); } } However, this seems not work at all, or the program report errors. I think the reason for this is that the C_P_M1 is not given memery. Who can help me to fix it? Thanks! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 22:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 21:38 |
Help: how to realize UDF on parallel cluster? | Haoyin | FLUENT | 1 | August 6, 2007 13:53 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 04:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 04:01 |