CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

How to build "Second Derivative " in UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   July 5, 2005, 04:38
Default How to build "Second Derivative " in UDF
Posts: n/a
Sponsored Links
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.
  Reply With Quote
Sponsored Links

Old   July 5, 2005, 23:58
Default Re: How to build "Second Derivative " in UDF
Posts: n/a
uds1 = du/dx in define adjust

store the gradient of uds

the udsi_g[0] is what you want
  Reply With Quote

Old   July 6, 2005, 00:18
Default Re: How to build "Second Derivative " in UDF
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.
  Reply With Quote

Old   July 6, 2005, 07:43
Default Re: How to build "Second Derivative " in UDF
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 dUDS/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.

  Reply With Quote

Old   October 17, 2012, 04:52
New Member
vaseem akram shaik
Join Date: Oct 2012
Posts: 12
Rep Power: 6
vsmkrm298 is on a distinguished road
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?
vsmkrm298 is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

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 03:38
can i get pressure derivative in UDF? ruirui389 Fluent UDF and Scheme Programming 4 April 8, 2011 04:12
UDF -BUILD chakradhar FLUENT 2 March 28, 2007 15:15
second derivative in udf dirk FLUENT 0 June 8, 2005 12:56
UDF for Second Derivative of Velocity Satish FLUENT 1 March 8, 2004 05:15

Sponsored Links

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