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

UDF :Unsteady concentration profile

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 11, 2003, 19:18
Default UDF :Unsteady concentration profile
  #1
umesh
Guest
 
Posts: n/a
hi

I want to simulate a batch process. It consists of a Packed bed reactor and Recycle Tank with a mixer. Output of Reactor (C1) goes to Tank and then recycled back to the Reactor (c2) Its a cyclic batch process. I had got steady state solution for the Reactor case. To get Unsteady solution, I had to use a UDF to describe the Tank Model which is

C2 = C1 * exp (- t / T )

I need to use the Exit conc. from reactor (c1), Calcuate C2 using UDF, which is function of time.T is constant

1. Is it possible to write such UDF.

2. Which Macros to use ?

3. How can I use the Exit Conc. (C1 )

Please give me some hint.. or a Sample UDF Any comments will be appreciated.

Thanks in advance

-Umesh

  Reply With Quote

Old   July 11, 2003, 21:48
Default Re: UDF :Unsteady concentration profile
  #2
ap
Guest
 
Posts: n/a
If I'm not wrong, you have a reactor, whose exit flow is mixed in a mixing tank (nothing added in this tank, just a mixing), which adds a delay of T sec in your system. So you want the concentration in the feed flow to the reactor to be equal to

C2 = C1 * exp(-t/T)

The term exp(-t/T) can be implemented using the macro

RP_Get_Real("flow-time")

to get the real flow time and using the standard C function for exp.

Determining C1 is a bit more difficult. Is C1 constant (like in a CSTR reactor) or has it a profile?

In both cases you have to loop on faces threads to find your outlet BC faces thread, using a loop like

thread_loop_f(f_thread, domain) /* loops over all face threads in a domain*/

{

if (THREAD_TYPE(f_thread) = = THREAD_F_OUTFLOW) /* Use this if your outlet is defined as OUTFLOW - Relplace THREAD_F_OUTFLOW with THREAD_F_POUTLET if you use PRESSURE OUTLET */

{

}

}

In the if statement you have to put the code which reads the concentration values. The only macro I know which gives something related to concentration is

F_YI(f,t,i)

which gives you the species mass fraction.

If C1 is constant on all the boundary surface, you just have to read it and save it in UDM, for example, so you can check your UDF is working properly.

If C1 has a profile, you could calculate a weighted-average value of it or, better, determine it's profile.

Hope this helps

Hi

ap
  Reply With Quote

Old   July 12, 2003, 04:45
Default Re: UDF :Unsteady concentration profile
  #3
Umesh
Guest
 
Posts: n/a
Dear ap,

You got my prooblem correctly. Your suggestions are useful.

Here, C1 is constant at the OUTFLOW BOUNDRY, but it will change with time. But it has a profile along the Bed height. I will Need C1 only at the OUTFLOW . so it is somewhat easier.

Thanks for your time.

--

  Reply With Quote

Old   July 12, 2003, 10:21
Default Re: UDF :Unsteady concentration profile
  #4
umesh
Guest
 
Posts: n/a
Hi,

For the system I mentioned previous message, It contains Two different speces .. So, I had to write the model C2 = C1 * exp(-t/T) for two different species.

Can I use IF..Else statement Like

if ( i = 1)

conc = C_YI(c,t,0)*exp(-t/T);

else

conc = C_YI(c,t,1)*exp(-t/T);

Will such UDF give correct results ?

Any comments are welcome..

Thanks in advance..

-Umesh
  Reply With Quote

Old   July 13, 2003, 18:07
Default Re: UDF :Unsteady concentration profile
  #5
ap
Guest
 
Posts: n/a
If both species are present at the same time, you don't need the if statement.

You just have to define the model twice: in other words, you have to implement two equations like:

C2 = C1*exp(-t/T)

and

C2' = C1'*exp(-t/T)

where C1 and C2 refer to the first species and C1' and C2' refer to the second species.

Hi

ap
  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
3D UDF Paraboilc Velocity Profile (Can't Maintain) Sing FLUENT 9 Yesterday 08:58
defining temperature profile with UDF mohammadkm Fluent UDF and Scheme Programming 11 July 3, 2013 01:15
udf for velocity profile in a geometry having two inlets shubham208011 Fluent UDF and Scheme Programming 0 April 6, 2009 16:13
Calculating material concentration profile Sungyeol CFX 0 February 17, 2009 05:44
UDF: PROFILE + SOURCE Nuno FLUENT 0 September 1, 2008 16:31


All times are GMT -4. The time now is 21:37.