CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   """Source Term in UDS""" (https://www.cfd-online.com/Forums/fluent/31256-source-term-uds.html)

Sebeci April 10, 2003 05:59

"""Source Term in UDS"""
 
Hi every body I want to add a source term in UDS. Suppose the scalar is "fi" and the source is S=A+B*(fi)+C*(d(fi)/dx). How can I produce d(fi)/dx ?

Thanks for your help

Murali April 10, 2003 11:27

Re: """Source Term in UDS"""
 
<font face = "courier new">You do not "produce" the derivative. You just calculate the derivative and enter the expression. Refer to the example of adding a momentum source in the UDF manual under DEFINE_SOURCE. It clearly explains.</font>

Sebeci April 12, 2003 00:12

Re: """Source Term in UDS"""
 
Thank for your response, but my PDE is

[d^2(fi)/d(x^2)]+[d^2(fi)/d(y^2)]=A*[d(fi)/dt]+B*(fi) +C*(d(fi)/dx

so, I want to add A+B*(fi)+C*(d(fi)/dx as a source term.

How can I do it? Please explain more.


Murali April 14, 2003 13:54

Re: """Source Term in UDS"""
 
<font face = "courier new">I presume you are not too familiar with the macro stuff in F6. I strongly suggest you go through Chapter 5 of the UDF manual.

That said, your problem can be tackled by accessing the derivatives of the particular variable from F6. Refer to page 5-5 of UDF manual to set up F6 for accessing the gradient information. I presume that "fi" in your equation is a UDS. Hence the derivative of the UDS is accessed by C_UDSI_G(c,t,1)

Now when you specify a source term for a variable phi you are NOT required to find out the derivative of that variable with respect to spatial coordinate, BUT the partial derivative of the "sourece term" eith respect to the variable.

Hence if fi^2 is the source term then B = 2*fi. find your B similarly and use the macros to get your expression.

Regards

Murali</font>

Murali April 14, 2003 18:12

Re: """Source Term in UDS"""
 
A small correction:

if fi^2 is the source term then B = 2*fi.

Sorry. It should read:

if fi^2 is then derivative of source term = 2*fi. Hence A= 0 and B = phi and dS[1] = 2*fi

Regards

Murali

Sebeci April 15, 2003 03:55

Re: """Source Term in UDS"""
 
Thanks for your help murali As another question, In general form of UDS (chapter 9.2) I assumed ro(Density) as porosity(coefficient of d(fi)/dt) ,but in my problem the porosity varies in the cells.I have a database file of prosity and want to assign it to the cells. How it's possible?

Thank you in advance

Murali April 16, 2003 12:46

Re: """Source Term in UDS"""
 
<font face = "courier new">Sebeci:

Nice qn. As far as I know porosity "cannot" be a user modifiable function in F6. I suggest you discuss this with FLUENT people.

Murali </font>


All times are GMT -4. The time now is 05:58.