CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

DEFINE_UDS_FLUX for eulerian model

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

LinkBack Thread Tools Search this Thread Display Modes
Old   April 2, 2019, 18:28
Default DEFINE_UDS_FLUX for eulerian model
New Member
Join Date: Oct 2016
Posts: 2
Rep Power: 0
Waid is on a distinguished road
Hi all,

i want to implement to mass flow rate of a secondary phase (eulerian model) through a given face by using a DEFINE_UDS_FLUX, in Fluent. Basically I want to use a code similar to the one in the Fluent manual (attached below), but I want the velocity for the flow to be the average between the velocity of the primary phase and the velocity of the secondary phase. I do not understand how to define the threads for each phase. Can you help me?

/************************************************** ********************/
/* UDF that implements a simplified advective term in the */
/* scalar transport equation */
/************************************************** ********************/

#include "udf.h"

cell_t c0, c1 = -1;
Thread *t0, *t1 = NULL;
real NV_VEC(psi_vec), NV_VEC(A), flux = 0.0;
c0 = F_C0(f,t);
t0 = F_C0_THREAD(f,t);
F_AREA(A, f, t);
/* If face lies at domain boundary, use face values; */
/* If face lies IN the domain, use average of adjacent cells. */
if (BOUNDARY_FACE_THREAD_P(t)) /*Most face values will be available*/
real dens;
/* Depending on its BC, density may not be set on face thread*/
dens = F_R(f,t); /* Set dens to face value if available */
dens = C_R(c0,t0); /* else, set dens to cell value */
NV_DS(psi_vec, =, F_U(f,t), F_V(f,t), F_W(f,t), *, dens);
flux = NV_DOT(psi_vec, A); /* flux through Face */ }
c1 = F_C1(f,t); /* Get cell on other side of face */
t1 = F_C1_THREAD(f,t);
NV_DS(psi_vec, =, C_U(c0,t0),C_V(c0,t0),C_W(c0,t0),*,C_R(c0,t0));
NV_DS(psi_vec, +=, C_U(c1,t1),C_V(c1,t1),C_W(c1,t1),*,C_R(c1,t1));
flux = NV_DOT(psi_vec, A)/2.0; /* Average flux through face */
/* ANSYS Fluent will multiply the returned value by phi_f (the scalar’s
value at the face) to get the ‘‘complete’’ advective term. */
return flux;

Last edited by Waid; April 3, 2019 at 12:27.
Waid is offline   Reply With Quote


eulerian model, flux, multiphase model, uuds

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
kklOmega omega boundary condition at the wall - OF3.0 Artur OpenFOAM Running, Solving & CFD 1 June 17, 2016 16:42
Turbulence model choice dave13 CFX 3 December 22, 2015 08:12
problem with solving lagrange reaction cloud Polli OpenFOAM Running, Solving & CFD 0 April 30, 2014 08:53
manualInjection model in sprayFoam Mentalo OpenFOAM Running, Solving & CFD 1 April 2, 2014 10:29
Problems bout CFD model of biomass gasification, Downdraft gasifier wanglong FLUENT 2 November 26, 2009 00:27

All times are GMT -4. The time now is 10:54.