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

Transient udf for limiting flux (solid fuel combustion)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 23, 2015, 09:46
Default Transient udf for limiting flux (solid fuel combustion)
  #1
Member
 
Baradwaj B S
Join Date: Jan 2015
Posts: 75
Rep Power: 11
Bharadwaj B S is on a distinguished road
Hi everyone,

My name is Bharadwaj B S, I am currently doing a project on solid fuel combustion (Single particle). In this I have created a sphere inside a cylindrical fluid domain.

There will be velocity inlet from one side of cylinder and another inlet from the surface of the sphere as mass flux( kg/m^2 s) signifying volatile release.

I have written a simple code where the flux from the sphere is arbitrarily dependent on sphere face temperature (F_T(f, t)). Upto 20 seconds there should be mass flux from the surface of the sphere, when the time reaches 20 seconds the mass flux from surface should stop. For this I have used the if else condition.

From the logic side it seems to be fine. But when I hook and see the result. It is not showing the flux from the surface.

QUESTION:

1. Is there any mistake in UDF (macro used, logic or anything)?
2. Can I use CURRENT_TIME in DEFINE_PROFILE?
Because there is a separate macro for transient Profiles. (DEINE_TRANSIENT_PROFILE).
3. Is there any correction in condition (if (time <= 20))??

Please reply at your earliest convenience. Any help will be of great use for me. Thanks in Advance.

UDF:

#include "udf.h"
#include "math.h"

real time;
real tmp;
real flx;
real a;
real b;
int i;
int ID = 13;
Thread *t;
face_t f;
cell_t c;

DEFINE_PROFILE(flux, t, i)
{
Domain *d;

d = Get_Domain(1);
t = Lookup_Thread(d, ID);
flx = 0.0;
tmp = 0.0;
a = - 0.5;
b = 0.0;
time = CURRENT_TIME;

begin_f_loop(f, t)
{
if(time <= 20)
{
flx = - a * tmp;
tmp = F_T(f, t);
F_PROFILE(f, t, i) = flx;
}
else
{
F_PROFILE(f, t, i) = b;
}
end_f_loop(f,t)
}
}
Bharadwaj B S is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
solid fuel combustion apo FLUENT 1 November 3, 2017 02:23
Combustion of fuel mixture muizzlkfle FLUENT 0 December 10, 2014 12:22
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 08:00
2 solid fuel combustion giant Main CFD Forum 0 May 24, 2005 07:46
udf for transient heat flux BC isaac FLUENT 1 June 3, 2004 17:29


All times are GMT -4. The time now is 17:39.