|
[Sponsors] |
June 8, 2015, 15:00 |
Volume of Fluid UDF for coordinates
|
#1 | |
Member
Rafal
Join Date: Aug 2013
Location: CK
Posts: 36
Rep Power: 12 |
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; } Quote:
My fluid zone ID taken from GUI is 2. I have two phases:
|
||
|
|
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 |