CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDF switch macro vs. call Law (

Christian November 15, 2002 11:23

UDF switch macro vs. call Law

Can anyone tell me when to use the DEFINE_DPM_SWITCH macro end when to call the Laws in my UDF.

Is it of no matter, or are these two methods really doing two different things?


Allan November 15, 2002 16:33

Re: UDF switch macro vs. call Law
I had the same question when using the customized laws. However, since it was simple, I wrote my own DEFINE_DPM_SWITCH macro and it worked so I never tried without it. Actually, since Fluent defines the fraction of the evaporating component on a volume rather than a mass basis I preferred my own method. And, it avoided some of my confusion dealing with separate laws for evaporation and boiling - one is all I needed.

Christian November 21, 2002 15:38

Re: UDF switch macro vs. call Law
Hi Allan.

Thank you for your answer. Now I have a new question :)

When the dpm is using a law, say law 2, do you know if the calculation is staying in that law until the two conditions no more are valid, or does the solver "look up" and into my switch macro. I would like to modify the density of the particle while the law 2 is active and not only after.


Allan November 22, 2002 16:10

Re: UDF switch macro vs. call Law

I'm not sure. I'm guessing you want to know if you set your own switch, will Fluent still try to use its own criteria to calculate the density.

In general, you would want to define things as explicity as possible - thus use your own switch rather than that built in to Fluent.

One way to check if it is using your definition for density is to plot the particle density versus time using the Fluent built-in panel and then plot the particle law for time for the same particle, and see when your density function is valid.

Or you can simply include a print statement where your density function is used to print the law at that time.

Some of the laws seem to calculate the density using the evaporating component as a volume fraction rather than a mass fraction, which I circumvented.

mahdi saniee nezhad November 24, 2002 02:15

Re: UDF switch macro vs. call Law
Dear sir I have a problem with this title. If it's possible for you please send me your received responses. Very thanks for your attention to my request. With the best regards. Mahdi saniee nezhad

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