|
[Sponsors] |
Setting up a UDF to monitor UDS mass fraction |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
MCKoz
Join Date: Apr 2018
Posts: 9
Rep Power: 8 ![]() |
Hi all,
I am attempting to write a UDF to describe the decrease in a species mass fraction value and am needing a bit of guidance. The mass fraction will be described by first order kinetics, where I have experimentally determined a k constant. I understand that i basically need to use the DEFINE_SOURCE macro to create a 'sink'. I have written some code, but am getting an error that says not enough parameters for macro DEFINE_SOURCE. Here is my code so far... #include "udf.h" DEFINE_SOURCE(cell_death,c,t,i) { real source; real k; k=0.0000108840 source=-k*C_UDSI(c,t,0); return source; } so I basically want to describe the rate of decrease is the species as dN/dt= -0.0000108840 * (local concentration). I have a UDS set up with an inlet mass fraction and have the index set correctly, I'm just needing some guidance on what I'm missing to make this UDF work and describe the species mass fraction properly. I would greatly appreciate any help that you all can offer. Best |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 ![]() ![]() |
From ansys fluent customization manual
macro looks like Code:
DEFINE_SOURCE (name, c, t, dS, eqn) Code:
/*******************************************************************/ UDF for specifying an x-momentum source term in a spatially dependent porous media *******************************************************************/ #include "udf.h" #define C2 100.0 DEFINE_SOURCE(xmom_source,c,t,dS,eqn) { real x[ND_ND]; real con, source; C_CENTROID(x,c,t); con = C2*0.5*C_R(c,t)*x[1]; source = -con*fabs(C_U(c, t))*C_U(c,t); dS[eqn] = -2.*con*fabs(C_U(c,t)); return source; } |
|
![]() |
![]() |
![]() |
Tags |
fluent - udf |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Simulation with UDF for species mass fraction and velocity profile | virgy | Fluent UDF and Scheme Programming | 8 | February 7, 2012 04:30 |
setting mass fraction...pliz help | vickrenz | FLUENT | 0 | August 27, 2009 01:18 |
PB: Saving mass fraction of species on two points with an udf | biget.a | FLUENT | 2 | July 23, 2009 03:06 |
Warning 097- | AB | Siemens | 6 | November 15, 2004 04:41 |
UDF for Species mass fraction | Rahul | FLUENT | 0 | September 20, 2002 04:22 |