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

accessing values at nodes

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 18, 2017, 07:53
Default accessing values at nodes
  #1
Member
 
sebastian bergman
Join Date: Mar 2017
Location: seattle
Posts: 52
Rep Power: 9
Tushar_Telmasre is on a distinguished road
hello,
I am solving solidification problem. I want to track a particular liquid fraction contour i.e. 0.7(C_iiqf=0.7). The final aim is to single out cells where liquid fraction is 0.7 and calculate temperature gradient value at that cell.

to track cells with liquid fraction 0.7. I followed following algorithm.

1. check whether the value of liquid fraction in particular cell is 0.7
2. if yes, A user defined memory(which I defined before) will have a value of 1.
3. if no, the user defined memory value will be 0.
4. loop over all cells and threads.

here is my UDF
#include "udf.h"

DEFINE_EXECUTE_AT_END(temp_gradient)
{
Domain *d;
Thread *t;
cell_t c;
d = Get_Domain(1);
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
if ( C_LIQF(c,t)==0.7)
{
C_UDMI(c,t,1)=0;
}
else
{
C_UDMI(c,t,1)=1;
}

end_c_loop(c,t)
}
}
}

I am expecting cells where liquid fraction is 0.7 have udm value 1 and rest cells have udm value 0. but at the end of the calculation I am getting all cells with udm value 1.
when I displayed contours of liquid fraction in solidification/melting I am getting region with liquid fraction 0.7.
Tushar_Telmasre is offline   Reply With Quote

Reply

Tags
if statement, solidification/melting, udm


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
Accessing field values with in a dynamic mesh motion class kcn OpenFOAM Programming & Development 2 July 21, 2015 01:52
F_NNODE returns double number of nodes falkon Fluent UDF and Scheme Programming 0 March 8, 2014 07:58
Create some nodes into an existing mesh and accessing to those nodes ooo OpenFOAM Programming & Development 0 November 2, 2013 19:03
Accessing Values of U_general questions harly OpenFOAM 3 December 8, 2008 15:14
Accessing Shear Rate Values in Subroutines Daniel Lattin Siemens 0 January 10, 2007 18:59


All times are GMT -4. The time now is 16:24.