|
[Sponsors] |
![]() |
![]() |
#1 |
Guest
Posts: n/a
|
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 |
|
![]() |
![]() |
![]() |
#2 |
Guest
Posts: n/a
|
<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>
|
|
![]() |
![]() |
![]() |
#3 |
Guest
Posts: n/a
|
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. |
|
![]() |
![]() |
![]() |
#4 |
Guest
Posts: n/a
|
<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> |
|
![]() |
![]() |
![]() |
#5 |
Guest
Posts: n/a
|
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 |
|
![]() |
![]() |
![]() |
#6 |
Guest
Posts: n/a
|
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 |
|
![]() |
![]() |
![]() |
#7 |
Guest
Posts: n/a
|
<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> |
|
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem of SOURCE term gradient in UDS | wind | Fluent UDF and Scheme Programming | 6 | December 1, 2022 14:21 |
momentum source term | zwdi | FLUENT | 14 | June 27, 2017 15:40 |
Large source term in species equation | MACFD | FLUENT | 4 | January 4, 2011 14:16 |
pressure gradient term in low speed flow | Atit Koonsrisuk | Main CFD Forum | 2 | January 10, 2002 10:52 |
bouyancy term in epsilon equation | Michael | Main CFD Forum | 1 | June 25, 1999 10:20 |