|
[Sponsors] |
September 28, 2017, 04:36 |
UDF for density variaiton
|
#1 |
New Member
Arslan Saleem
Join Date: Jun 2017
Posts: 9
Rep Power: 9 |
I'm trying to model air-vapor mixture using the species transport model. The flow is incompressible, but the density variation due to temperature or humidity is taken into consideration using the expression given below:
rho=p/(RT(m/M)) where, m is the mass fraction of species and M is the molecular weight of the species I have written a UDF but on interpretation, it's giving a "structure implementation error". Here is the UDF: #include "udf.h" DEFINE_PROPERTY(cell_density, c, t) { real sum=0; int i; Material *sp; real rho; real m=18.01534; real R= UNIVERSAL_GAS_CONSTANT/m; Property *prop; mixture_species_loop(THREAD_MATERIAL(t),sp,i) { prop= (MATERIAL_PROPERTY(sp)); rho= generic_property(c,t,prop,PROP_rho,C_T(c,t),C_P(c, t)); sum += C_P(c,t)/(R*C_T(c,t)*(C_YI(c,t,i)/m)); } return sum; } |
|
Tags |
density variation, fluent, species transport, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
Parallelize UDF? Which kind of UDF? | Lilly | FLUENT | 5 | March 25, 2014 03:05 |
Help! Delete the UDM codes in the UDF | Messi | Fluent UDF and Scheme Programming | 2 | January 28, 2014 10:01 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |