|
[Sponsors] |
July 5, 2005, 05:38 |
How to build "Second Derivative " in UDF
|
#1 |
Guest
Posts: n/a
|
In my UDF, it has second derivative such as (d2u/dx2). I see in fluent and it has only du/dx. How can I write secon derivative in UDF? Thank you in advance.
|
|
July 6, 2005, 00:58 |
Re: How to build "Second Derivative " in UDF
|
#2 |
Guest
Posts: n/a
|
uds1 = du/dx in define adjust
store the gradient of uds the udsi_g[0] is what you want |
|
July 6, 2005, 01:18 |
Re: How to build "Second Derivative " in UDF
|
#3 |
Guest
Posts: n/a
|
Thank you very much Joey. I wonder something. If my derivative is not by dx, what can I do. For example, I would like to write d(scalar)/du which u is velocity.
|
|
July 6, 2005, 08:43 |
Re: How to build "Second Derivative " in UDF
|
#4 |
Guest
Posts: n/a
|
I recently asked Fluent support how to calculate second derivative, as I also needed it for UDS source term. There is no macro to compute it and they also proposed me to define another uds as the derivative of the first uds. You then have to assign these uds after or before every iteration and set very low relaxation factors (1e-10 or so) for them, so that they do not change. It worked in my case, but the problem is you need to solve three additional transport equations in 3D, one for each derivative dUDS/dx_i which costs time and memory.
Another method should be to use divergence theorem, as described in the manual for second order upwind discretization: grad(Phi)=sum_faces(Phi_face*face_area_vector)/volume. If you set Phi here as dUDS/dx_i you should get your required derivative d²UDS/dx_i². For that you need to know the gradients at the faces. I tried to manage this with interpreted UDF but failed in compiling. Maybe you or someone else can do this and tell me. Dirk |
|
October 17, 2012, 05:52 |
|
#5 |
New Member
vaseem akram shaik
Join Date: Oct 2012
Posts: 12
Rep Power: 14 |
Hi Dirk,
Actually i am also facing same kind of problem in which, i need the second derivative of scalar, i dont understand the answer given by you. Can u please elaborate it? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to get a second derivative in udf? | demigod | Fluent UDF and Scheme Programming | 8 | September 28, 2015 04:38 |
can i get pressure derivative in UDF? | ruirui389 | Fluent UDF and Scheme Programming | 4 | April 8, 2011 05:12 |
UDF -BUILD | chakradhar | FLUENT | 2 | March 28, 2007 16:15 |
second derivative in udf | dirk | FLUENT | 0 | June 8, 2005 13:56 |
UDF for Second Derivative of Velocity | Satish | FLUENT | 1 | March 8, 2004 05:15 |