CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

udf - get second derivative of a converged velocity field

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 3, 2019, 16:09
Default udf - get second derivative of a converged velocity field
  #1
New Member
 
David
Join Date: Nov 2017
Posts: 14
Rep Power: 9
uconcorde is on a distinguished road
Hello,

I am trying to use ADJUST macro to get second derivatives of my converged velocity field, but I got all zero values. Here is the code and procedure I am using. Can you please help me to find any mistake I have?

Code:
# include "udf.h"

DEFINE_ADJUST(adjust_gradient,domain)

{

Thread *t;

cell_t c;

face_t f;

domain = Get_Domain(1);

thread_loop_c(t,domain)

{

   begin_c_loop(c,t)

   {

      C_UDSI(c,t,0) = C_DUDX(c,t); // calculate d2u/dx2

   }

   end_c_loop(c,t)

}

}

Procedure:

1) Open my .cas file

2) Interpreted udf

3) Open my converged .dat file

4) User defined -> Scalars -> 1 -> Solution Zones: all fluid zones; Flux Function: none; Unsteady Function: none

5) Solving -> deselect User Scalar 0

6) Run calculation for 1 time steps

7) Check contour plot of User Defined Scalar: all zero values.



Best,

Dv
uconcorde is offline   Reply With Quote

Old   July 4, 2019, 01:01
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
you dont need scalar, change to udmi
you should allocate memory for UDMI

Code:
C_UDMI(c,t,0) = C_DUDX(c,t); // calculate d2u/dx2
best regards
AlexanderZ is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accuracy of the velocity field in a low speed wind tunnel? hob Main CFD Forum 1 April 24, 2016 15:35
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Simulation with UDF for species mass fraction and velocity profile virgy Fluent UDF and Scheme Programming 8 February 7, 2012 05:30
velocity of massless particles and velocity of flow field in same coordinate payam_IUST FLUENT 0 October 19, 2009 00:24
UDF for Second Derivative of Velocity Satish FLUENT 1 March 8, 2004 05:15


All times are GMT -4. The time now is 13:21.