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

DEFINE_DIFFUSIVITY loop question

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Ryan

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 26, 2006, 14:27
Default DEFINE_DIFFUSIVITY loop question
  #1
Ryan
Guest
 
Posts: n/a
Hello All -

I am trying to simply define the diffusivity properties of 5 different species for two different zones. I have decided using if loops is the most efficient. Everything appears to be in order, and the UDF hooks to fluent just fine, but when I attempt to begin iterating, I get "Floating Point Error: invalid number." I am not sure if fluent is even recognizing the coefficients I am putting in. Please Help!!! Cheers

#include "udf.h" DEFINE_DIFFUSIVITY(protondiff,c,t,i) {

real D; int zone_ID = THREAD_ID(t);

if (i == 1){

if (zone_ID==2)

{D = 2.03e-15;}

if (zone_ID==3)

{D =2.03e-15;} return D;} if (i == 2){

if (zone_ID==2)

{D = 8.91e-10;}

if (zone_ID==3)

{D = 9.90e-10;} return D;} if (i == 3){

if (zone_ID==2)

{D = 1.9285e-11;}

if (zone_ID==3)

{D = 2.03e-11;} return D;} if (i == 4){

if (zone_ID==2)

{D = 4.275e-11;}

if (zone_ID==3)

{D = 4.5e-11;} return D;} if (i == 5){

if (zone_ID==2)

{D =2e-15;}

if (zone_ID==3)

{D = 2e-15;} return D;} }
Rui_27 likes this.
  Reply With Quote

Old   July 4, 2006, 04:15
Default Re: DEFINE_DIFFUSIVITY loop question
  #2
rom
Guest
 
Posts: n/a
I am not shure but i think species numeration starts with 0 and not 1. Try 0..4 instead of 1..5 . And let the function always retun a value and not only if one of those "if" conditions is true.

Good luck
  Reply With Quote

Old   July 5, 2006, 12:20
Default Re: DEFINE_DIFFUSIVITY loop question
  #3
Ryan
Guest
 
Posts: n/a
Thanks, Im going to try using else if, and at the end add a else => return D
  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
question about uds tanven FLUENT 2 July 5, 2015 12:22
basic question with 'ForAll' loop Pascal_doran OpenFOAM Post-Processing 10 December 14, 2012 18:39
OpenFOAM basic Question a_yoshi OpenFOAM 1 October 29, 2009 05:13
Basic Question a_yoshi OpenFOAM 2 October 29, 2009 01:45
Poisson Solver question Suresh Main CFD Forum 3 August 12, 2005 05:37


All times are GMT -4. The time now is 18:06.