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

DEFINE_INIT PROBLEM

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 13, 2008, 18:11
Default DEFINE_INIT PROBLEM
  #1
Craig
Guest
 
Posts: n/a
/* This function initializes my domain on the left side with species 0 at 300K and species 1 at 600K on the right side. domain is 1 meter long */

#include "udf.h"

DEFINE_INIT(my_init_function,d) { cell_t c; Thread *t; real xc[ND_ND];

thread_loop_c(t,d) {

begin_c_loop_all (c,t)

{

C_CENTROID(xc,c,t);

if (xc[0] < 0.5)

{

C_T(c,t) = 300.;

C_YI(c,t,0) = 0.;

}

else

{

C_T(c,t) = 600.;

C_YI(c,t,0) = 1.;

}

}

end_c_loop_all(c,t) } }

  Reply With Quote

Old   August 13, 2008, 18:16
Default DEFINE_INIT PROBLEM DESCRIPTION
  #2
Craig
Guest
 
Posts: n/a
The above UDF compiles and runs when hooked. The temperature on the left is 300K and the temp on the right is 600K. Species 0 is on the left and Species 1 is on the right.

However, when i zoom into the walls on the right side, the wall nodes appear to be initialized with Species 0.

I think that I need to add an f_loop to initialize nodes on the wall but the temperature loop seemed to work fine. Any ideas?

  Reply With Quote

Old   August 14, 2008, 01:28
Default Re: DEFINE_INIT PROBLEM DESCRIPTION
  #3
Smith_K
Guest
 
Posts: n/a
Assign the species mass fraction in the wall boundary conditions. By default the mass fraction of all the species will be zero. You do not need a UDF to assign the same on the walls. Regards,

  Reply With Quote

Old   August 14, 2008, 17:34
Default Re: DEFINE_INIT PROBLEM DESCRIPTION
  #4
Craig
Guest
 
Posts: n/a
Thanks for the response.

My wall boundary is set to: Zero Diffusive Flux for species and 0 Heat Flux for Temp. So, my wall species and Temp is allowed to float based on what happens in the interior.

When I initialize the domain to one temp and species without the UDF using solve/initialize I see that all interior nodes and wall nodes are at the initialized species and temperature.

When I initialize the domain using my UDF I find that only the interior nodes are properly initialized (because I have only looped on cell centroids).

Since I don't want to specify species or temp as a boundary condition, I believe that I must do something extra with my UDF to initialize the remaining part of my domain that my begin_c_loop missed.

Thanks again.

  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
DEFINE_INIT in multiphase eulerian model isabel FLUENT 0 January 21, 2009 15:13
need help whith hooking UDF and DEFINE_INIT macro cax FLUENT 3 June 6, 2006 12:35
problem in solving "wave generation" problem san FLUENT 2 April 3, 2006 23:37
field initialization using DEFINE_INIT Maziar Mahzari FLUENT 0 September 14, 2005 02:36
about DEFINE_INIT mikhail FLUENT 1 October 13, 2000 23:17


All times are GMT -4. The time now is 15:41.