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

Volume of Fluid UDF for coordinates

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   June 8, 2015, 15:00
Unhappy Volume of Fluid UDF for coordinates
  #1
Member
 
Rafal
Join Date: Aug 2013
Location: CK
Posts: 36
Rep Power: 12
vekh is on a distinguished road
Hello guys!
I need to write UDF that will return x and y (and z for 3D) coordinates of place where there is fractional quantity of phase (black box region at the picture).
As I'm quite new to the all multiphase things I've used code from this forum. After few changes it's look like:
Code:
#include "udf.h"

DEFINE_SOURCE(source,c,t,dS,eqn)
{
real source, alpha, xc[ND_ND];
Thread *mixture_thread;
Thread **pt;
Domain *domain; 
int zoneid = 2;
domain = Get_Domain(1);
mixture_thread = Lookup_Thread(domain,zoneid);
pt = THREAD_SUB_THREADS(mixture_thread);

alpha = C_VOF(c,pt[1]);
Message("cell volume fraction = %f \n xc = %f \n yc = %f \n",alpha, xc[0], xc[1]);
source =2;
dS[eqn] = 0;
return source;
}
Sadly, the messages in Fluent console returns only:
Quote:
cell volume fraction = 0.000000
xc = 0.000000
yc = 0.000000
cell volume fraction = 1.000000
xc = 0.000000
yc = 0.000000
few times.
My fluid zone ID taken from GUI is 2. I have two phases:
  • argon phase (ID 2)
  • air phase (ID 3)
Could someone give me some hint?
Attached Images
File Type: png nt.png (7.8 KB, 43 views)
vekh is offline   Reply With Quote

 


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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 06:09
multiphase turbulance case floating error harsha_kulkarni OpenFOAM Running, Solving & CFD 3 February 18, 2016 05:06
Multiphase simulation of bubble rising Niru CFX 5 November 25, 2014 13:57
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 14:11
fluid hot volume in fluid cold volume zahid FLUENT 4 June 1, 2002 09:11


All times are GMT -4. The time now is 13:38.