- **FLUENT**
(*https://www.cfd-online.com/Forums/fluent/*)

- - **UDS n It's source term
**
(*https://www.cfd-online.com/Forums/fluent/32726-uds-n-its-source-term.html*)

UDS n It's source term
Dear all,
I have an equation to solve. I think I can use UDS for that. The eqn is like, A div(phi)=-((phi)^2)/B Where A and B are constant values. Now I need to solve this differential eqn. using UDS for phi. Can anybody suggest how I can do that. Thanks for your time and effort. Umesh |

Re: UDS n It's source term
Hi, I kinda face the same kind of problem recently but I did not have yet enought time to test my programm lines so I am interested in your problem and the way to solve it. Here is some thoughts.
According to your equation, I agree to say phi needs to be solved by a scalar (UDS or UDSI -> same thing). UDS transport equation transport are composed of 4 terms: advection, unsteaday, diffusion, source term. I think only the source term can help you to get the solution of your problem. So what I personaly did and what I would suggest is to declare in a UDF a DEFINE_SOURCE. In this define_source devlare a UDSI = phi. There you are gonna be able to get macro to calculate the gradient 'C_UDSI_G(c,t,i)'in all direction. Therefore you can calulate you DIV(phi) term and get your solution phi. According to what I read on the documentation C_UDSI_G seems to be a matrix, so you need to compute a dot product to calculate you divergenge term. Then hook you source term in your fluid zone panel next to the term scarlar_(i) (i = indenfier you gave to your UDSI (0,1,2,3....). Do not forget to declare your sclar BCs. Hope I am enought clear and do not forget to let me know how your results are going and how is the life at Western ? Who are you working with ? What department are you in ? Cheers :) Thomas |

Re: UDS n It's source term
yeah Thomas, I need to to have the DEFINE_SOURCE to solve (phi^2)/B. But the problem is how can I implement this equation in UDS. What I mean is, the UDS solves
div^2(phi) = S while my differential equation of kind, div(phi) = S How can I solve this equation. do you get my point? Well, I m doing Masters' in Chemical engineering dept. My personal experience with western is good, I like the campus and work environment. Where are you and what do you do? thanks Umesh |

Re: UDS n It's source term
Hey, Well I do not understand what you mean by 'UDS is solving div^2(phi) = S' and sincerely I have never seen the operator div^2 before, unless you try a way to mean the laplacian operator in the duffusivy term of the transport equation. your equation is A.div(phi)=-((phi)^2)/B so your solution will be to find in each cells the value of 'phi' which will be phi(cell) = square [A/B . div(phi)]. Am I wrong ? You might also discretize the 'phi(cell)' term but I don't see the interest of doing that as long as phi(cell) is the exact value of the solution you want. So the only unknown you have is div(phi)= d(phi)/dx + d(phi)/dy + d(phi)/dy (obviously phi is not a vector but a scalar also called potential). So the way to calculate that is to define phi as a UDSI(c,t,i) and calculate the right dot_product with the gradient matrix C_UDSI_G(c,t,i). Then put that in a DEFINE_SOURCE which will allow you to get the 'phi' value. Of course the source term will be the only term of your scalar transport equation which means when you declare your UDSI in fluent you are gonna to put 'none' to 'unsteady' and 'flux' term. So the DEFINE_SOURCE and the UDS is a way to solve your equation. However I wonder if you cannot replace the define_source and the UDS by modifying the DEFINE_FLUX macro, better user could answer. This is the way I see it. You or someone else can show me if I am wrong and I would be very interested to know why !
I was in western last year in the chem. department for an exchange. I did the 497 project with Prakash and Ali was my ghost TA :). I am french and undergraduate in Process Eng. Wait for your answer. thomas |

All times are GMT -4. The time now is 20:18. |