# How to build "Second Derivative " in UDF

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

 July 5, 2005, 04:38 How to build "Second Derivative " in UDF #1 Bowling 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 5, 2005, 23:58 Re: How to build "Second Derivative " in UDF #2 Joey 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, 00:18 Re: How to build "Second Derivative " in UDF #3 Bowling 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, 07:43 Re: How to build "Second Derivative " in UDF #4 dirk 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, 04:52 #5 New Member   vaseem akram shaik Join Date: Oct 2012 Posts: 12 Rep Power: 6 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?

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post demigod Fluent UDF and Scheme Programming 8 September 28, 2015 03:38 ruirui389 Fluent UDF and Scheme Programming 4 April 8, 2011 04:12 chakradhar FLUENT 2 March 28, 2007 15:15 dirk FLUENT 0 June 8, 2005 12:56 Satish FLUENT 1 March 8, 2004 05:15

All times are GMT -4. The time now is 17:03.