CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

F_UDMI can't get the value with thread_loop_f loop

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By `e`

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2016, 09:53
Default 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
hamidreza118 is on a distinguished road
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)
}
}
hamidreza118 is offline   Reply With Quote

Old   June 4, 2016, 19:14
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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));
If you're viewing the face values via the GUI (for example, contours), then they will appear zero because Fluent draws from cell values. Apply the same temperature to your UDM at the neighbouring cell if you want to plot the contours in Fluent. Furthermore, if you're plotting by node values then you may need to run an iteration to allow Fluent to interpolate the values from the cell centres.
hamidreza118 likes this.
`e` is offline   Reply With Quote

Old   June 5, 2016, 06:35
Default
  #3
New Member
 
Hamidreza
Join Date: Jun 2014
Posts: 9
Rep Power: 12
hamidreza118 is on a distinguished road
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
hamidreza118 is offline   Reply With Quote

Reply


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
[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


All times are GMT -4. The time now is 21:12.