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

How to call volume fraction in UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 16, 2017, 07:14
Default How to call volume fraction in UDF
  #1
New Member
 
anubhav
Join Date: Sep 2014
Posts: 8
Rep Power: 11
anubhavd is on a distinguished road
Dear All

I am writing a udf in which I need to call the volume fraction of primary and secondary phase to calculate some quantity. My case has two phases and I am using Eulerian multi phase. Please help in calling the Volume fractions I am attaching the body of the written UDF. The part which seems confusing to me is marked as red in the attached udf. Is the attached code is correct??

#include "udf.h"
#include "sg_pb.h"
#include "sg_mphase.h"

DEFINE_PB_NUCLEATION_RA_rate_J, cell, thread)
{


double J, rho, A, mol_wt, P, K, C, VF_w, VF_b, T;


Thread *tc = THREAD_SUPER_THREAD(thread);
Thread **pt = THREAD_SUB_THREADS(tc);
Thread *tp = pt[P_PHASE];



T = 300;
mol_wt = 0.018; /* ......unit 'Kg/mol'*/
rho = 1000; /* ......unit 'Kg/m^3)*/
A = 6.023*pow(10,23); /* ......dimensionless*/
K = 1.3807*pow(10,-23); /* ......J K-1*/

VF_w = C_VOF(cell,pt[0]);

VF_b = C_VOF(cell,pt[1]);

C = (rho * VF_w* A/mol_wt);
P = C*K*T;


J = 150000;

C_UDMI(cell, thread, 0) = VF_w;
C_UDMI(cell, thread, 1) = VF_b;
C_UDMI(cell, thread, 2) = C;
C_UDMI(cell, thread, 3) = P;


return J;

}
anubhavd is offline   Reply With Quote

Reply

Tags
multiphase modelling, pbm model udf, udf code


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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
alphaEqn.H in twoPhaseEulerFoam cheng1988sjtu OpenFOAM Bugs 15 May 1, 2016 16:12
Stuck in a Rut- interDyMFoam! xoitx OpenFOAM Running, Solving & CFD 14 March 25, 2016 07:09
multiphase turbulance case floating error harsha_kulkarni OpenFOAM Running, Solving & CFD 3 February 18, 2016 05:06
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 21:14


All times are GMT -4. The time now is 04:48.