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

UDS Flux function

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 8, 2003, 10:22
Default 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
  Reply With Quote

Old   July 8, 2003, 20:31
Default 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
  Reply With Quote

Old   July 9, 2003, 06:28
Default 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); ???
  Reply With Quote

Old   July 9, 2003, 19:00
Default 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
  Reply With Quote

Old   July 10, 2003, 11:09
Default 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?

  Reply With Quote

Old   July 10, 2003, 19:19
Default 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
  Reply With Quote

Old   July 11, 2003, 05:09
Default 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.
  Reply With Quote

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

Hi

ap
  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
UDS Flux Function Choice Yang Chung FLUENT 1 November 17, 2015 02:14
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
Compilation errors in ThirdPartymallochoard feng_w OpenFOAM Installation 1 January 25, 2009 07:59
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51
Calcuationg mass flux of a UDS? Derek FLUENT 0 March 20, 2006 08:58


All times are GMT -4. The time now is 04:21.