CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

UDF for specifying species mass fraction gradient at boundary

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

LinkBack Thread Tools Display Modes
Old   August 17, 2013, 05:18
Default UDF for specifying species mass fraction gradient at boundary
New Member
Saumitra Joshi
Join Date: Dec 2012
Posts: 14
Rep Power: 7
Zaphod'sSecondHead is on a distinguished road
Dear Members,

Pardon me, I am a complete newbie in the UDF sector.

I am modeling two-component purely diffusive species transport. At the boundary, I wish to specify the condition: del.C = 0, that is, the gradient of concentration at exit is zero. I used Mass Fraction as a measure of concentration.

UDF Logic:

1. Create a UDS, say UDS1, and store in it the value of mass fraction.
2. Create another UDS, say UDS2, and store in it the gradient of UDS1.
3. At boundary, specify the value of UDS2 to be zero.

I created the following UDF:
__________________________________________________ __________
#include "udf.h"

DEFINE_PROFILE(conc_grad, t, i)
cell_t c;
Thread *f_thread;
Domain *domain;

domain = Get_Domain(1);

thread_loop_c (f_thread, domain)
begin_c_loop (c, t)
C_UDSI(c, t, 0) = C_YI(c, t, i); /*First UDS*/
C_UDSI(c, t, 1) = NV_MAG(C_UDSI_G(f, t, 0)); /*Second UDS*/
end_c_loop (c, t)

__________________________________________________ _____________
After successfully interpreting the file, I set the exit boundary as "Outflow", and in the "Boundary Conditions -> Edit -> UDS" tab, specify the value as "udf conf_grad" in the drop-down menu.

After clicking OK, I get the ACCESS VIOLATION error.

I really do not know what the problem is. Could someone help me out please?

Thanks in advance.
Zaphod'sSecondHead is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem of simulating of small droplet with radius of 2mm liguifan OpenFOAM Running, Solving & CFD 5 June 3, 2014 02:53
Radiation interface hinca CFX 15 January 26, 2014 18:11
CFX13 Post Periodic interface EtaEta CFX 7 December 8, 2011 18:15
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14
mass fraction of species Ahmed FLUENT 0 April 18, 2007 11:57

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