|
[Sponsors] |
F_UDMI can't get the value with thread_loop_f loop |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 4, 2016, 09:53 |
F_UDMI can't get the value with thread_loop_f loop
|
#1 |
New Member
Hamidreza
Join Date: Jun 2014
Posts: 9
Rep Power: 12 |
Hello Dear Engineers,
I want to store the values of face temperature, where the face is a shadow face created as a result of solid/fluid interaction. i can store the temperature of adjacent cell successfully by this code: DEFINE_ON_DEMAND(tempstore) { real temp; Domain *domain; Thread *c_thread, *tw; cell_t cell, c0, c1; face_t f; int ID = 7; domain = Get_Domain(1); tw=Lookup_Thread(domain,ID); thread_loop_c(c_thread,domain) { begin_c_loop(cell,c_thread) { C_UDMI(cell,c_thread,6)=C_T(cell,c_thread); } end_c_loop(cell,c_thread) } } but when i want to store the values of face temperatures, either I get zero values by the first code below or a fatal signal error by the second code.. Anyone has any idea what's wrong? DEFINE_ON_DEMAND(tempstore) { real temp; Domain *domain; Thread *c_thread, *tw; cell_t cell, c0, c1; face_t f; int ID = 7; domain = Get_Domain(domain_ID); tw=Lookup_Thread(domain,ID); thread_loop_c(c_thread,domain) { begin_c_loop(cell,c_thread) { C_UDMI(cell,c_thread,6)=C_T(cell,c_thread); } end_c_loop(cell,c_thread) } begin_f_loop(f,tw) { F_UDMI(f,tw,7)=F_T(f,tw); } end_f_loop(f,tw) } } Thanks in Advance. DEFINE_ON_DEMAND(tempstore) { real temp; Domain *domain; Thread *c_thread, *tw; cell_t cell, c0, c1; face_t f; int ID = 7; /*corresponding to the boundary zone the face temp. is needed*/ domain = Get_Domain(domain_ID); tw=Lookup_Thread(domain,ID); thread_loop_c(c_thread,domain) { begin_c_loop(cell,c_thread) { C_UDMI(cell,c_thread,6)=C_T(cell,c_thread); } end_c_loop(cell,c_thread) } thread_loop_f(tw,domain) { begin_f_loop(f,tw) { F_UDMI(f,tw,7)=F_T(f,tw); } end_f_loop(f,tw) } } |
|
June 4, 2016, 19:14 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
The thread_loop_f in the second UDF isn't required; I'm not surprised there's an error for this case.
Are you sure the face values of your UDM is zero on the boundary? Try checking the values from another execute on demand macro which prints the face values to screen: Code:
Message("F_UDMI(f,tw,7) = %e\n",F_UDMI(f,tw,7)); |
|
June 5, 2016, 06:35 |
|
#3 |
New Member
Hamidreza
Join Date: Jun 2014
Posts: 9
Rep Power: 12 |
Thanks 'e'. using Message("F_UDMI(f,tw,7) = %e\n",F_UDMI(f,tw,7)) it got clear that my face is getting the correct value and you were right about me plotting the values with GUI and getting 0.. so everything is ok about faces value and again thanks a bunch However while I'm trying to impose this F_UDMI as a Boundary Condition i'm not getting the desired result while when i use C_UDMI(c0,t0,7) i get the boundary values correctly and have no idea what's going on.. anyway i'm using C_UDMI instead... thanks again
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field | lakeat | OpenFOAM Community Contributions | 58 | December 23, 2021 03:36 |
[Other] refineWallLayer Error | Yuby | OpenFOAM Meshing & Mesh Conversion | 2 | November 11, 2021 12:04 |
[Gmsh] Problem with Gmsh | nishant_hull | OpenFOAM Meshing & Mesh Conversion | 23 | August 5, 2015 03:09 |
[CAD formats] my stl surface is seen as just a line | rcastilla | OpenFOAM Meshing & Mesh Conversion | 2 | January 6, 2010 02:30 |
NACA0012 geometry/design software needed | Franny | Main CFD Forum | 13 | July 7, 2007 16:57 |