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

Add Mass to a Particle with UDF (DPM)

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 19, 2010, 04:12
Default Add Mass to a Particle with UDF (DPM)
  #1
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
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!
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   January 19, 2010, 04:27
Default
  #2
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
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 ...
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   January 19, 2010, 13:46
Default
  #3
Member
 
Allan Walsh
Join Date: Mar 2009
Posts: 56
Rep Power: 17
Allan Walsh is on a distinguished road
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.
Allan Walsh is offline   Reply With Quote

Old   January 19, 2010, 15:02
Default
  #4
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Quote:
Originally Posted by Allan Walsh View Post
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?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   January 20, 2010, 12:56
Default
  #5
Member
 
Allan Walsh
Join Date: Mar 2009
Posts: 56
Rep Power: 17
Allan Walsh is on a distinguished road
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.
Allan Walsh is offline   Reply With Quote

Old   January 20, 2010, 13:10
Default
  #6
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Quote:
Originally Posted by Allan Walsh View Post
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?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   October 24, 2013, 22:14
Default UDF for particle sticking to wall
  #7
New Member
 
Ali Hosseini
Join Date: Jun 2013
Location: Edmonton
Posts: 3
Rep Power: 12
alihosseini63 is on a distinguished road
Quote:
Originally Posted by sega View Post
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?
alihosseini63 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
HELP! adding a mass source to VOF eqn. by UDF??? ROOZBEH FLUENT 5 December 3, 2016 17:53
particle, parcel and mass flow rate balance flybird FLUENT 0 May 24, 2007 10:44
UDF solution variable for time-averaged mass frac? A. S. FLUENT 0 May 14, 2007 16:44
Particle mass flow rate Jeff CFX 3 September 17, 2004 10:46
Help: UDF problem--How to add bodyfore to the DPM KE FLUENT 3 August 18, 2003 08:02


All times are GMT -4. The time now is 05:09.