|
[Sponsors] |
May 1, 2018, 10:55 |
Problem with calculating second derivative
|
#1 |
New Member
Guan-Bang Wang
Join Date: Apr 2018
Posts: 14
Rep Power: 8 |
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; } |
|
Tags |
second derivative |
|
|
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 |