|
[Sponsors] |
Problem with assigning uds a value when calculating second derivative |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 3, 2018, 22:53 |
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 |
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; } |
|
Tags |
second derivative |
|
|
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 |