CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

How to realize the desorption by using UDF?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 23, 2011, 12:13
Default How to realize the desorption by using UDF?
  #1
New Member
 
Liu Lang
Join Date: May 2011
Posts: 1
Rep Power: 0
milkbag is on a distinguished road
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!
milkbag is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


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 23: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 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 01:59.