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

udf problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 7, 2006, 03:20
Default udf problem
  #1
jim
Guest
 
Posts: n/a
hi Using UDF, I try to calculate the accumulated concentration of species. but I have some problem. What kind of UDF do i use?

  Reply With Quote

Old   June 7, 2006, 05:37
Default Re: udf problem
  #2
cax
Guest
 
Posts: n/a
hi Can you tell us more abot the system you are modelling? what do you want to know about the species? if you want to know their mass fractions you should use the C_YI macro have a look in the fluent manual see you
  Reply With Quote

Old   June 7, 2006, 20:23
Default Re: thanks..but...
  #3
jim
Guest
 
Posts: n/a
thanks your answer I hope you understand that I can't speak English well. I want to know the accumulated mass fraction data in fluent. 1) unsteady solver 2) nh3 species 3) using UDF, I want to accumulate the mass fraction data each time step 4) I want to see the contour of accumulated value in fluent Is it possible?

  Reply With Quote

Old   June 9, 2006, 16:41
Default Sorry for intervention
  #4
Amr
Guest
 
Posts: n/a
I noticed your posts about that UDF. I posted since a while, a request of help in a heat source UDF that is going to be represented in trasient simulation of fire in a room. The UDF should supply heat source from zero to 6 MW in 100 seconds. Could any body help me how to write it?. I am not good with C++.

Cheers, Amr
  Reply With Quote

Old   June 9, 2006, 20:31
Default Re: Sorry for intervention
  #5
jim
Guest
 
Posts: n/a
I am not good with C++,too I hope you understand me that I can't speak English well. I think you can use the DEFINE_SOURCE macro and RP_Get_Real.

First you must define the "flow-time"... then..you can define the MW - value of fire souce according "flow-time"

DEFINE_SOURCE(Energy, cell, thread, dS, eqn ) { real flow_time = RP_Get_Real("flow-time");

cell_t c;

begin_c_loop (c,thread)

{

if(flow_time >= 100)dS[eqn] = " " ;

else

dS[eqn] =" " ;

}

end_c_loop (c,thread)

return dS[eqn];

}

I write the UDF simply

you must input the value between " "... except "flow_time"

I hope you understand my explanation. If I can speak English well, I will help you more...I am sorry..good luck!
  Reply With Quote

Old   June 10, 2006, 19:38
Default Re: Sorry for intervention
  #6
Amr
Guest
 
Posts: n/a
Hi Jim:

Thanks much for your post. Anyways, I really don't get what you mean by RP_Get_Real. Also, why do I use a macro instead of a simple profile file or UDF to give the transient MW's values?.

In your last message, do I only write in between the " "? What does dS eqn means?.

Thanks so much. I owe you.

Cheers, Amr
  Reply With Quote

Old   June 11, 2006, 19:42
Default Re: Sorry for intervention
  #7
jim
Guest
 
Posts: n/a
Hi Amr

you're look in fluent manual about my answer.

1) RP_Get_Real....is returns current simulation time

2) because you want to input the value of heat source from zero to 6 MW in 100 seconds, UDF is more useful than simple profile file (... I think so)

3) According your volum of source term, MW's values are different. you must input the value between quotation marks

4) DEFINE_SOURCE macro

There are five arguments to DEFIEN_SOURCE....DEFINE_SOURCE(name,c,t,dS,eqn)

dS specifies the derivative of the source term with respect to the dependent variable of the transport equation
  Reply With Quote

Old   June 11, 2006, 21:05
Default Re: Sorry for intervention
  #8
Amr
Guest
 
Posts: n/a
Thanks again Jim !.

One more question here: Do I need to specify something in "eqn" or it is only a programming symbol?. Same question applies to c and t symbols.

Cheers, Amr

  Reply With Quote

Old   June 12, 2006, 03:05
Default Re: Sorry for intervention
  #9
jim
Guest
 
Posts: n/a
Your thinking is right. "eqn","c","t" are programming symbols.

  Reply With Quote

Old   June 12, 2006, 23:41
Default Re: Sorry for intervention
  #10
Swarup
Guest
 
Posts: n/a
Hi all,

Just a couple of things to note!

You should have a "Source" equation for which to write its derivative dS. First comes source, then its derivative. Check UDF manual.

I guess you are talking about ramping up your heat source (from 0 to 6 MW in 100 s). This should give you a clue about your Source equation.

Swarup.

  Reply With Quote

Old   June 14, 2006, 01:32
Default Re: Sorry for intervention
  #11
Amr
Guest
 
Posts: n/a
Hi Swarup,

Could you illustrate this in the udf? Thanks much for your input. Have you been into heat generation problems before???

Cheers, Amr
  Reply With Quote

Old   June 14, 2006, 23:06
Default Re: Sorry for intervention
  #12
Swarup
Guest
 
Posts: n/a
You may have already done that. I will tell in short.

You need your current flow time. Access it using CURRENT_TIME.

you then write a simple equation source=coeffi*CURRENT_TIME such that when your CURRENT_TIME is 100 s you get the final value. your dS[eqn]=0.0 since it does not depend upon any primitive variable. eqn is the number provided by solver once you hook your UDF in appropriate zone and variable. Energy source UDF hook is at the end of list of possible hooks.

I have not tried heat generation problems before.

Swarup
  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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 06:05
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56
UDF problem mansha goraya FLUENT 0 October 29, 2007 00:31
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
UDF problem chiseung FLUENT 4 January 10, 2002 09:58


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