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

Mass transfer UDF expecting void return

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 8, 2014, 18:36
Default Mass transfer UDF expecting void return
  #1
New Member
 
Join Date: Jan 2014
Posts: 2
Rep Power: 0
Quinos is on a distinguished road
Hello everyone,

I am trying to write a DEFINE_MASS_TRANSFER UDF for my FLUENT model. The code is attached below. This is a test UDF since it just returns a single value at the moment.

My UDF can be interpreted(via Define -> User-Defined -> Functions -> Interpreted...) without errors, and I can select the specific UDF in my model afterwards, but when I try and run my model, the following errors come up.

What am I doing wrong? Any help would be appreciated; I'm new at this.

Quote:
Updating solution at time level N... done.
iter continuity x-velocity y-velocity z-velocity energy hydrogen+-ph hydrogen+-ph vf-phase-2 time/iter
chip-exec: simple_diff: wrong return type: void udf function expected
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: #f
Code:
// UDF to define a simple mass transfer based on simple diffusion from One to Two

#include "udf.h"

DEFINE_MASS_TRANSFER(simple_diff,cell,thread,from_index,from_species_index,to_index,to_species_index)
{
	real m_ot, D_ot;
	real est_area, flux_ot;
	Thread *one = 
	THREAD_SUB_THREAD(thread,from_index);
	Thread *two = 
	THREAD_SUB_THREAD(thread,to_index);
	
	//m_ot = 0.;
	//D_ot = 9.31*pow(10,-9);
	//est_area = pow(C_VOLUME(cell,one),2.0/3.0);
	//flux_ot = -D_ot*(C_YI(cell,one,from_species_index)-C_YI(cell,two,to_species_index));
	//m_ot = flux_ot*est_area*1.7*pow(10,-27)*6*pow(10,23)*C_VOLUME(cell,one);
	
	//return (m_ot);
	real X = 5.0;
	
	return(X);
}
Quinos is offline   Reply With Quote

Reply


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
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
Water subcooled boiling Attesz CFX 7 January 5, 2013 03:32
Hooking a DPM Particle Heat and Mass Transfer UDF to FLUENT subhankar_bhandari Main CFD Forum 0 August 19, 2010 03:01
writing UDF for modelig mass transfer for VOF ardalan soleymani FLUENT 0 July 11, 2007 01:09
Heat and Mass Transfer UDF Srinivas Parimi FLUENT 3 August 22, 2005 13:49


All times are GMT -4. The time now is 12:19.