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

Problem with calculating second derivative

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 1, 2018, 10:55
Post Problem with calculating second derivative
  #1
New Member
 
Guan-Bang Wang
Join Date: Apr 2018
Posts: 14
Rep Power: 8
coewgb is on a distinguished road
Hello,
I am trying to calculate the second derivative of temperature using additional user defined scalars, i.e., uds 1~3 in the following code (uds 0 is another user defined scalar whose transport equation will be solved.
I also deselected the transport equations of uds 1~3 in solution controls to retain the values which were defined by the code.
However, as the monitors indicated, the maximum values of uds 1~3 kept zero during the calculation, while the maximum temperature gradient in each direction is not zero as well as the minimum thermal conductivity.
Therefore, it seemed that the values of uds 1~3 were not correctly defined as shown in the code.
Could anyone tell me the reason and the solution?
Thanks a lot.

DEFINE_ADJUST(adjust_gradient, domain)
{
Thread *t;
cell_t c;

domain = Get_Domain(1);

thread_loop_c(t, domain)
{
begin_c_loop(c, t)
{
C_UDSI(c, t, 1) = C_K_EFF(c, t, 0.85)*C_T_G(c, t)[0];
C_UDSI(c, t, 2) = C_K_EFF(c, t, 0.85)*C_T_G(c, t)[1];
C_UDSI(c, t, 3) = C_K_EFF(c, t, 0.85)*C_T_G(c, t)[2];
}
end_c_loop(c, t)
}
}

DEFINE_SOURCE(cell_uds_source, cell, thread, dS, eqn)
{
real source;
source = 2.0*(C_UDSI_G(cell,thread,1)[0]+ C_UDSI_G(cell, thread, 2)[1]+ C_UDSI_G(cell, thread, 3)[2]);
dS[eqn] = 0;
return source;
}
coewgb is offline   Reply With Quote

Reply

Tags
second derivative


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
[General] Calculating time derivative of scalar field Jack001 ParaView 0 July 10, 2016 14:11
[General] Problem in calculating Gradient masaaki ParaView 0 March 16, 2015 07:38
a problem in drag coefficient calculating anijdon OpenFOAM 1 March 20, 2013 13:11
Problem: calculating drag coefficient RFH_student FLUENT 3 February 8, 2011 09:36
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 20:13


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