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

getting a cell variable

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 1, 2016, 11:25
Default getting a cell variable
  #1
New Member
 
Hamidreza
Join Date: Jun 2014
Posts: 9
Rep Power: 11
hamidreza118 is on a distinguished road
Hello dear Engineers
I have two Zones in my simulation, one "fluid" and one "solid" and there are two boundaries named "interface" and "interface_shadow" introducing the interface between these zones. i'm trying to implement a UDF and i'm using DEFINE_PROFILE in one of the zones, say fluid, and i've used THREAD_T0 and F_C0 to get the cells and cell threads adjacent to the interface located in the fluid zone. But the point is that I want to get Solid's cells and cell threads next to the interface located in solid zone too! so i have no idea how I can access to those cells while i'm using a DEFINE_PROFILE in one zone and i need cell variables in another zone.. Here's how my code looks like:


DEFINE_PROFILE(flux,f_thread,index)
{
real flux_jump;
face_t face;
cell_t cell;
Thread *c_thread;
cell_t scell;
Thread *sc_thread;
begin_f_loop(face,f_thread)
{
cell=F_C0(face,f_thread);
c_thread=THREAD_T0(f_thread);
scell=F_C1(face,f_thread);
sc_thread=THREAD_T1(f_thread);
flux=A*(C_T(cell,c_thread)-C_T(scell,sc_thread));
F_PROFILE(face,f_thread,index) = flux;
}
end_f_loop(face,f_thread)
}

THIS PROFILE IS TO BE USED ON THE BOUNDARY OF BOTH INTERFACES OF SOLID AND FLUID. I HAD NO IDEA HOW TO GET TEMPERATURE OF SOLID CELL ADJACENT TO INTERFACE SO I JUST USED THREAD_T1 AND F_C1 BUT ERROR OCCURRED SINCE I HAVE NO ACCESS TO GET THE TEMPERATURE OF SOLID CELLS NEXT TO THE INTERFACE. I think I have to get the other DOMAIN by GET_DOMAIN or something. is it right???
THANKS IN ADVANCE.
hamidreza118 is offline   Reply With Quote

Old   July 11, 2016, 10:14
Default
  #2
New Member
 
Join Date: Jun 2016
Posts: 7
Rep Power: 9
iteration is on a distinguished road
In your case, I think, the usage of sc_thread in C_T(scell,sc_thread)) throws the error. Is that right?
I also don't know if F_C1(face,f_thread) can be used to access a value of a cell across an interface at all.

I would be glad if someone else could resolve my uncertainty.

Last edited by iteration; July 13, 2016 at 05:42.
iteration is offline   Reply With Quote

Reply

Tags
access

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Setting cell variable values in a fluid zone using UDF eromon84 Fluent UDF and Scheme Programming 6 March 28, 2021 12:59
Cell Variable Macro Names (C_x_x...) for UDFs meangreen Fluent UDF and Scheme Programming 3 January 15, 2021 04:44
access the information of the neighbour cell across a processor boundary? sophie_l OpenFOAM Programming & Development 4 August 9, 2016 15:05
Cells with t below lower limit Purushothama Siemens 2 May 31, 2010 22:58
Defining and assigning a variable to a cell Robi FLUENT 0 July 13, 2005 19:27


All times are GMT -4. The time now is 05:59.