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 assigning uds a value when calculating second derivative

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 3, 2018, 22:53
Smile Problem with assigning uds a value when 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 by assigning the first derivative to 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 assigned 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 assigned 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
[swak4Foam] problem with slave cells using toposet while calculating volume flux with swak4foam Andy_Wang OpenFOAM Community Contributions 0 October 14, 2016 14:20
Problem of calculating divergence due to wrong boundary vaule of finite area mesh lzhou OpenFOAM Programming & Development 2 June 18, 2015 06:10
uds problem in solid zone alireza2475 FLUENT 2 October 19, 2013 17:13
How to use UDS solve this problem risklotus FLUENT 5 January 25, 2013 01:21
Calculating lift force of a wind turbine blade problem LittleBart CFX 4 June 29, 2011 03:33


All times are GMT -4. The time now is 22:54.