CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Writing UDF for Eulerian model

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 17, 2010, 09:29
Default Writing UDF for Eulerian model
  #1
Member
 
farhad
Join Date: Mar 2010
Location: Tehran
Posts: 32
Rep Power: 7
golriz is on a distinguished road
Dear all
I have a question about writing UDF for Eulerian model. I need to write some codes for diameter of particles in DEFINE_PROPERTY Macrose. I want to apply a linear changing diameter in my code, but I do not know that the diameter is function of what?(depth or time or ....)
I hope some persons help me in writng this UDF.
Best regards,
Golriz
golriz is offline   Reply With Quote

Old   December 16, 2010, 03:56
Default
  #2
akm
New Member
 
Join Date: Jan 2010
Location: United Kingdom
Posts: 27
Rep Power: 7
akm is on a distinguished road
@golriz
did u find a way to code??
i want to change the phase diameter after a certain number of flow time steps.
akm is offline   Reply With Quote

Old   December 17, 2010, 01:54
Default
  #3
Member
 
farhad
Join Date: Mar 2010
Location: Tehran
Posts: 32
Rep Power: 7
golriz is on a distinguished road
Hi akm,
Unfortunately, I can not find it!
Regards,
golriz is offline   Reply With Quote

Old   December 18, 2010, 10:53
Default
  #4
Senior Member
 
Real Name :)
Join Date: Jan 2010
Location: United States
Posts: 180
Rep Power: 7
ComputerGuy is on a distinguished road
Phase diameter can be changed according to whatever rules you'd like to impose -- this is a relatively standard Fluent capability. Bubble/droplet diameters are, however, influenced by fairly complex physics. Imagine a single bubble of air rising in a column of water:
  1. Bubble diameter changes according to the density of the air, which is influenced by the ambient pressure and the temperature of the air
  2. If the bubble grows too large, the bubble will subdivide to minimize its surface energy

Now, think about many bubbles in a column. Not only will they undergo some of the things above, but you'd also have to worry about coalescence of the bubbles.

At any rate, below is a code (untested, not checked for syntax errors) which should show geometry dependent bubble behavior.

Code:
DEFINE_PROPERTY(bubble_diam, cell, thread)
{
	real bubble_diam_function_of_height;
	real max_size,min_size;
	
	
	/* Arbitrary physics -- geometry (height) dependent bubbles */
	real xc[ND_ND];
	C_CENTROID(xc,cell,thread);
	
	max_size=1e-1;
	min_size=1e-6;
	
	/* Assumes that the base of the geometry has a y-coordinate 0 */
	/* Assumes that bubbles grow linearly with decreasing depth (unlikely purely linear) */
	/* Assumes that bubbles have a 1 micron diameter at the base of the geometry */
	
	bubble_diam_function_of_height=(1.54244e-08)*xc[1]+1.e-6;
	
	
	if (bubble_diam_function_of_height > max_size)
	{
		bubble_diam_function_of_height = max_size;
	}
	else if (bubble_diam_function_of_height < min_size)
	{
		bubble_diam_function_of_height = min_size;
	}
	
	return bubble_diam_function_of_height;
}
The code assumes growth in the +y direction.

Let me know if this answers your question.

ComputerGuy

Last edited by ComputerGuy; December 18, 2010 at 14:26.
ComputerGuy is offline   Reply With Quote

Old   December 23, 2010, 08:53
Default
  #5
Member
 
farhad
Join Date: Mar 2010
Location: Tehran
Posts: 32
Rep Power: 7
golriz is on a distinguished road
Thanks for your answer and Iím sorry for being so late in my reply.
Your code helps me very much, but regarding your explanation I have to mention some points about my modeling:
- In my modeling I have to impose eight diameters for particles (bubbles) in all of the inlet cells. In other words I have different size of particles in one cell.
- The diameters of particle never change with any other things such as temperature or density and only have different size at inlet and also in one cell.
- Inlet cells have completely similar conditions.
Now how can I impose this condition to the model?
Regards,
golriz is offline   Reply With Quote

Old   December 23, 2010, 14:31
Default
  #6
Senior Member
 
Real Name :)
Join Date: Jan 2010
Location: United States
Posts: 180
Rep Power: 7
ComputerGuy is on a distinguished road
Golriz,

If I understand you correctly, you have two phases: let's say air (which makes up the bubbles) and water.

You want to simulate the air phase as a series of 8 separate bubble diameters, which are unaffected by coalescence, breakup, temperature, pressure etc...

I don't know what version of Fluent you're using, but the simplest way to do this (in terms of problem setup, not computation) is the following:

1) Create two fluid materials: air and water, for example.
2) Make the model multiphase, and have 9 phases
3) The primary phase is water
4) The secondary phases (i.e., phases 2-9) are air, with bubble diameters as you'd like. Phase diameters can therefore remain fixed throughout the simulation, and each "phase" or "bubble diameter's" drag/momentum behavior is solved without the need for complex UDFs.
5) The phase fraction (bubble distribution) of every phase can be specified at the inlet


Of course, if you have Fluent 12 (or the appropriate add-on license in Fluent 6), you could simply enable the population balance module and perform a simulation with discrete bin sizes for a single secondary phase (air). It's a little more elegant (and likely computationally less intensive) than the simple solution I've proposed above, but for the physics you're describing, shouldn't be much different in terms of results.

Regards,
ComputerGuy

Last edited by ComputerGuy; December 23, 2010 at 16:23.
ComputerGuy is offline   Reply With Quote

Old   December 24, 2010, 13:37
Default
  #7
Member
 
farhad
Join Date: Mar 2010
Location: Tehran
Posts: 32
Rep Power: 7
golriz is on a distinguished road
ComputerGuy,
Thanks again for your solution. You understood me correctly. This way is only time-consuming.
Regards,
Golriz
golriz is offline   Reply With Quote

Old   November 3, 2011, 06:30
Default udf code for rosin-rammler distribution
  #8
New Member
 
Thanh
Join Date: Feb 2010
Posts: 11
Rep Power: 7
thanhndb is on a distinguished road
Quote:
Originally Posted by ComputerGuy View Post
Phase diameter can be changed according to whatever rules you'd like to impose -- this is a relatively standard Fluent capability. Bubble/droplet diameters are, however, influenced by fairly complex physics. Imagine a single bubble of air rising in a column of water:
  1. Bubble diameter changes according to the density of the air, which is influenced by the ambient pressure and the temperature of the air
  2. If the bubble grows too large, the bubble will subdivide to minimize its surface energy
Now, think about many bubbles in a column. Not only will they undergo some of the things above, but you'd also have to worry about coalescence of the bubbles.

At any rate, below is a code (untested, not checked for syntax errors) which should show geometry dependent bubble behavior.

Code:
DEFINE_PROPERTY(bubble_diam, cell, thread)
{
    real bubble_diam_function_of_height;
    real max_size,min_size;
 
 
    /* Arbitrary physics -- geometry (height) dependent bubbles */
    real xc[ND_ND];
    C_CENTROID(xc,cell,thread);
 
    max_size=1e-1;
    min_size=1e-6;
 
    /* Assumes that the base of the geometry has a y-coordinate 0 */
    /* Assumes that bubbles grow linearly with decreasing depth (unlikely purely linear) */
    /* Assumes that bubbles have a 1 micron diameter at the base of the geometry */
 
    bubble_diam_function_of_height=(1.54244e-08)*xc[1]+1.e-6;
 
 
    if (bubble_diam_function_of_height > max_size)
    {
        bubble_diam_function_of_height = max_size;
    }
    else if (bubble_diam_function_of_height < min_size)
    {
        bubble_diam_function_of_height = min_size;
    }
 
    return bubble_diam_function_of_height;
}
The code assumes growth in the +y direction.

Let me know if this answers your question.

ComputerGuy
Hi ComputerGuy,

I am also dealing with the Eulerian multiphase model for the solid-gas fluidization. I would like to simulate with the non-uniform distributuon of the solid particles. But I dont know how to write a udf code for the granular diameter distribution such as Rosin-Rammler. So, could you give me some suggestions about that, or if possible could you give a sample code of diameter distribution for the secondary phase in tre Eulerian-granular multiphase model.

Thank you so much in advance!

Thanh
thanhndb 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: volume fraction gradient in eulerian model jwwang FLUENT 22 April 15, 2015 06:27
UDF VOF model on Fluent baechtel Fluent UDF and Scheme Programming 6 February 19, 2013 01:56
Problem with udf radiation model in 2d combustion model..???? shshiva17 FLUENT 0 July 28, 2009 09:44
How to model a Casson flow in UDF MKS FLUENT 1 September 26, 2006 20:37
UDF for fuel cell model Anant FLUENT 0 January 3, 2005 08:27


All times are GMT -4. The time now is 04:32.