# UDS Flux function

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

 July 8, 2003, 09:22 UDS Flux function #1 Andrew Garrard Guest   Posts: n/a Hello everyone. I have a qestion regarding fluent UDS's. am trying to use a UDS to model species concentration. My question is this: do you have to specify the same flux function for all your uds's. Any help would be appreciated. Regards

 July 8, 2003, 19:31 Re: UDS Flux function #2 ap Guest   Posts: n/a No, you can specify a different flux function for every UDS you define. In the flux definition DEFINE_UDS_FLUX ( name, f, t, i) i refers to the number of the UDS. If you have to define more than one scalar, using different flux expressions, you can use a conditional if statement in your UDF to define a different flux function for each i. i = 0 is associated with scalar-0 (the first scalar equation being solved). See FLUENT UDF manual: look for DEFINE_UDS_FLUX in the Index. Hi ap

 July 9, 2003, 05:28 Re: UDS Flux function #3 Andrew Garrard Guest   Posts: n/a Thanks for the help. I was hoping there was a simple way of doing it within the FLUENT GUI without having to write a UDF. I have been looking throught the documentation. I only wish to invoke the flux function that appears on as mass flow on the UDS menu drop down. Is it possiable so simply do something like: DEFINE_USD_FLUX(f,t, i) { if i=1 return F_FLUX(f, t); } Also, if I wish to return no flux function, as in none on the USD drop down, how should I code this: if i=0 return(void); ???

 July 9, 2003, 18:00 Re: UDS Flux function #4 ap Guest   Posts: n/a From the UDS drop down menu you can select a global option for the flux (mass flow or none) for all UDS you defined. If you need an individual flux for your UDS, you need to use DEFINE_UDS_FLUX. Yes, you can define your flux like DEFINE_USD_FLUX(f,t, i) { if i=1 return F_FLUX(f, t); } if this is what you need. I think return(void) or return 0 should work for the null flux, but I never tried. Hi ap

 July 10, 2003, 10:09 Re: UDS Flux function #5 Andrew Garrard Guest   Posts: n/a I have created a small test simulation in fluent to try and get two different uds's to solve with two different flux funciotns. I have created two differnt UDS's with exactly the same boundary conditons and the same diffusivity. When I select none for flux function they solve one way and when I select mass flow rate they solve a compleatly different way. When I select UDF I cannot get my conditional if statement to make them solve differently. I am trying several permuatation all a bit like: DEFINE_UDS_FLUX(all_udf_flux, f, t, i) { if (i = 0) return F_FLUX(f, t); else return 0; } But nothing seems to work and I cannot see any logic in how the code is accessing and running my UDF. It either solves with mass flow or without for both. Am I missing something obvious?

 July 10, 2003, 18:19 Re: UDS Flux function #6 ap Guest   Posts: n/a If convective terms of your equations are relevant, it's not strange you have different solutions if you consider (mass flow) or don't consider (none) them. Regarding the definition of your flux, in the function you posted, the comparison in the if statement is made using = instead of = =. The compiler should show an error message for this. The right sintax should be: DEFINE_UDS_FLUX(all_udf_flux, f, t, i) { if (i = = 0) { return F_FLUX(f, t); } else return 0; } This function defines a convective flux in the form rho * v for the first UDS (0) and a zero convective flux for others UDS. Tell me if you solved your problem. Hi ap

 July 11, 2003, 04:09 Re: UDS Flux function #7 Andrew Garrard Guest   Posts: n/a I have not tried your suggestion yet, but reading what you wrote, I think I know what the problem is. I forgot my basic c programming and used the assign i=0 rather than the is equel to i==0 statement. I suspected that I was missing something simple. Thanks for your help. I will try and be less stupid in the future.

 July 11, 2003, 16:59 Re: UDS Flux function #8 ap Guest   Posts: n/a You're welcome Hi ap

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42 feng_w OpenFOAM Installation 1 January 25, 2009 07:59 Yang Chung FLUENT 0 August 10, 2008 06:57 jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51 Derek FLUENT 0 March 20, 2006 08:58

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