|
[Sponsors] |
Calculating flow variables only once in begin_f_loop() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 25, 2020, 04:14 |
|
#61 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
so I have written a code for " Tf = Ts + ks(dT/dn)" in which Tf is fluid temperature, Ts is the wall temperature and ks is temperature jump coefficient.
DEFINE_PROFILE(temperaturejump, thread, position) { face_t f; cell_t c; Thread *tc; double b = 0.000001; double dTdy ,tem ,walltemp; begin_f_loop(f, thread) { c = F_C0(f,thread); tc = THREAD_T0(thread); dTdy = C_T_G(c,tc)[1]; walltemp = F_T(f, thread); tem = (b*dTdy) + walltemp; F_PROFILE(f, thread, position) = tem; } end_f_loop(f, thread) } is it correct or does it have any problem?? |
|
June 25, 2020, 04:19 |
Code
|
#62 |
Senior Member
|
The code is correct, but missing the commands that I shared earlier for storing temperature gradient.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 25, 2020, 04:37 |
|
#63 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
so should i add them within the loop?
and another question is that does the expression "F_T(f, thread)" gives wall temperature? or do i have to use "C_T(c, thread)" instead? |
|
June 25, 2020, 04:43 |
Code
|
#64 |
Senior Member
|
You need to add those three lines outside the loop.
F_T is good. C_T gives cell temperature.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 25, 2020, 04:56 |
|
#65 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
okay. but im having a trouble with hooking the UDFs. where do i have to hook this temperature jump? for the face (adjacent to solid) or for the shadow(adjacent to fluid) ??
|
|
June 25, 2020, 06:57 |
Temperature Jump
|
#66 |
Senior Member
|
The profiles are same for a wall and its shadow. If you hook it to one, it automatically works for the other. And that's where you have trouble since the jump should exist only on the fluid side. So, DEFINE_PROFILE may not be a good idea. Use DEFINE_ADJUST, access the thread on the fluid size, and then change the temperature. Let the coupled condition be as it is so that thermal energy conservation could be maintained.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 25, 2020, 09:23 |
|
#67 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
aha I think I understand what you are saying, do you mean if I use DEFINE_ADJUST, it would implement the heat transfer(conduction) between the face and its shadow by itself too, right?
|
|
June 25, 2020, 10:06 |
Correct
|
#68 |
Senior Member
|
That's what a default coupled condition does. In reality, there is no conduction between a boundary and its shadow. They are same. When they are coupled, the heat flux entering one is equal to heat flux exiting other, i.e., thermal energy is conserved.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 25, 2020, 10:22 |
|
#69 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
but the problem Im having here is that I need to apply both conditions to the liquid-solid interface, I mean I need to apply temperature jump to shadow(adjacent to fluid) temperature and also I need to have a coupled condition between face and shadow. but in fluent I can only either apply temperature jump or just have coupled condition, not both of them at a time. what should I do?
|
|
June 25, 2020, 11:00 |
Define_adjust
|
#70 |
Senior Member
|
That's why you need to use DEFINE_ADJUST. You can apply jump using UDF and coupled condition will maintain the conservation across shadow pairs.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 25, 2020, 11:27 |
|
#71 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
okay. now I understand. thank you very much for your help
|
|
June 25, 2020, 12:22 |
|
#72 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
so I have read about DEFINE_ADJUST macro. but I dont know how does it work!? what are the differences between this and DEFINE_PROFILE? which arguments should I use ? and to which part of FLUENT should I apply that?
|
|
June 27, 2020, 10:31 |
|
#73 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
You mean first I have to write a DEFINE_ADJUST which includes temperature jump function in it and hook it to function hooks and then leave the thermal boundary conditions for faces and their shadows as coupled. right?
|
|
June 30, 2020, 11:55 |
|
#74 |
Member
Homayoon sohrabi
Join Date: May 2020
Posts: 56
Rep Power: 6 |
Hi again
I have written a code by DEFINE_ADJUST for temperature jump as follows : DEFINE_ADJUST(temperaturejump3, domain) { Domain *d; int zone_ID = 16; Thread *f_thread = Lookup_Thread(domain, zone_ID); Thread *c_thread; cell_t cell; face_t face; double dTdy, temp, walltemp; double b = 0.000001; thread_loop_f (f_thread,domain) { begin_f_loop(face,f_thread) { cell = F_C0(face,f_thread); c_thread = THREAD_T0(f_thread); walltemp = F_T(face,f_thread); dTdy = C_T_G(cell,c_thread)[1]; F_PROFILE(face, f_thread, zone_ID) = (b*dTdy) + walltemp; } end_f_loop(face,f_thread) } } is it correct or does it need any modifying?? Thanks in advance |
|
Tags |
fluent - udf - parallel, slip b.c., slip flow, udf and programming |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF program for calculating the mass flow outlet with a pulsed output flow | Benito89 | Fluent UDF and Scheme Programming | 9 | August 22, 2019 00:57 |
Match Pressure Inlet/Outlet Boundary Condition Mass Flow Rate | MSchneid | Fluent UDF and Scheme Programming | 3 | February 23, 2019 07:00 |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 06:21 |
Calculating mass flow rate at multiphase flows | Kuslo187 | OpenFOAM Post-Processing | 1 | August 21, 2015 19:11 |
How to update polyPatchbs localPoints | liu | OpenFOAM Running, Solving & CFD | 6 | December 30, 2005 18:27 |