CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Add Mass to a Particle with UDF (DPM) (http://www.cfd-online.com/Forums/fluent-udf/71885-add-mass-particle-udf-dpm.html)

sega January 19, 2010 05:12

Add Mass to a Particle with UDF (DPM)
 
Hello World.

I'm using the Discrete Phase Model and I'm toying around with the UDF.
So I want to "simply" add mass to the particle with an UDF:

Code:

#include "udf.h"
#include "dpm.h"

DEFINE_DPM_SOURCE(dpm_source,c,t,S,strength,p)
{
    P_MASS(p) = 2 * P_MASS(p);
}

... which is not working. I'm not familiar with UDF so far, please be kind if I made some stupid mistake.

Here is the log-file:
Code:

myudf.c:1:2: error: invalid preprocessing directive #inlcude
myudf.c:2:2: error: invalid preprocessing directive #inlcude
myudf.c:6: warning: return type defaults to int
myudf.c: In function DEFINE_DPM_SOURCE:
myudf.c:7: warning: implicit declaration of function P_MASS
myudf.c:7: error: lvalue required as left operand of assignment

Thank you!

sega January 19, 2010 05:27

Well, it's not working because I mistyped "include" ...

I have correted it, can compile but the UDF is not doing what I want: add mass to the particle ...

Allan Walsh January 19, 2010 14:46

Why don't you use the DPM laws to describe coal particle combustion? You can customize each of the laws through the UDF's. For example, I don't know when your DPM_SOURCE macro would even be visited by the code to change the particle mass. Keep in mind that modifying macros may require weeks or months of work to do what you want.

sega January 19, 2010 16:02

Quote:

Originally Posted by Allan Walsh (Post 243100)
Why don't you use the DPM laws to describe coal particle combustion? You can customize each of the laws through the UDF's. For example, I don't know when your DPM_SOURCE macro would even be visited by the code to change the particle mass. Keep in mind that modifying macros may require weeks or months of work to do what you want.

The goal of my work is to describe the reaction kinetics of minerals inside a coal plant. With the model we want to able to decide if the ash-minerals will stick to the walls or not.

I think customizing the laws may be the right approach to this kind of problem. But at this stage I'm simply toying around with the UDF in general.
Obviously this was misleading.

So what do you think maybe the right approch to this kind of problem?
I have to define a particle with different mineral fractions, introduce and solve the reaction kinetics equations for each of them and thus alter the composition of the particle. (An UDF for the calculation of the viscosity and thus to decide if the particle adheres to the wall allready exists.)

Will this be possible with the coal combustion laws?

Allan Walsh January 20, 2010 13:56

The use of udfs for particle laws seems to be the logical approach. You can define variables external to the macros, such that they are available where needed-probably not the proper method for c++ but it works. Then you will need a customized wall boundary condition to determine if the particle sticks. The example in the UDF manual for erosion gives some hints. Good luck.

sega January 20, 2010 14:10

Quote:

Originally Posted by Allan Walsh (Post 243197)
The use of udfs for particle laws seems to be the logical approach. You can define variables external to the macros, such that they are available where needed-probably not the proper method for c++ but it works. Then you will need a customized wall boundary condition to determine if the particle sticks. The example in the UDF manual for erosion gives some hints. Good luck.

As mentioned before, the "sticky" part is allready available.
Corrently I am more interessted in the reaction kinetics.
Are there some examples available anywhere?

alihosseini63 October 24, 2013 22:14

UDF for particle sticking to wall
 
Quote:

Originally Posted by sega (Post 243199)
As mentioned before, the "sticky" part is allready available.
Corrently I am more interessted in the reaction kinetics.
Are there some examples available anywhere?

Hi guys

I'm also working on slag formation during coal gasification and I need to write UDF to give criterion to FLUENT to say which particles will stick to wall and which particles won't stick, do you have any idea or any sample UDF in this matter?


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