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

Need help on mass source at wall boundary!

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 16, 2007, 02:40
Default Need help on mass source at wall boundary!
  #1
James
Guest
 
Posts: n/a
Hi all,

I need help on the above and had written a UDF to describe mass source and sink at wall boundary between 2 adjacent flow channels. In short, I would like to simulate one specie from the feed flow channel to pass through a wall(membrane), which i simulate by having the cells adjacent to the wall to have a mass sink. While on the permeate side I would like to simulate that this same specie permeats through the wall at the adjacent cells to the wall to act like a mass source.

I had written a UDF using Define_source and attached it below. Can someone help me comment on it as it doesnt seem to work when I add it into the simulation? Thanks alot.

# include "udf.h"

DEFINE_SOURCE(membrane_flux,c,t,ds,eqn) { face_t f; Thread *tf, *tfs, *t0, *t1; cell_t c0, c1; real osmotic_P1, osmotic_P2, mem_flux, source=0; int n;

c_face_loop(c,t,n) { f=C_FACE(c,t,n); tf=C_FACE_THREAD(c,t,n); if(BOUNDARY_FACE_THREAD_P(tf)) /* must be thread face */ {

if(!NULLP(tfs=THREAD_SHADOW(tf))) /* thread face too */

{

c0=F_C0(f,tf);

c1=F_C1(f,tf);

t0=THREAD_T0(tf);

t1=THREAD_T1(tf);

Source = /* This is for calculations to return the source/sink term */

}

else

{

} } else { } } return source; }
  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
Very technical question about solving wall boundary layer ... jlb001 FLUENT 6 December 27, 2014 06:56
Version 15 on Mac OS X gschaider OpenFOAM Installation 120 December 2, 2009 11:23
mass flow in is not equal to mass flow out saii CFX 2 September 18, 2009 08:07
Mass source, Momentum source theory. diffo FLUENT 4 August 21, 2009 10:26
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 22:02.