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

How to rewrite devolatilization by UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2009, 05:18
Default How to rewrite devolatilization by UDF
  #1
New Member
 
studyudf
Join Date: Apr 2009
Posts: 2
Rep Power: 0
studyudf is on a distinguished road
I am going to rewrite devolatilization by DEFINE_DPM_LAW in coal burn model.I will use coal thermogravimetry curve to replace devolatilization model.I know the switch condition of pulverized coal combustion process to be achieved in Switch Law.I don't know how Fluent programs about the weight loss rate of pulverized coal particles in Devolatilization.And I don't know how the loss of quality converts into volatile.Who can help me?
studyudf is offline   Reply With Quote

Old   November 30, 2010, 06:42
Default Custom law UDF
  #2
Member
 
Neil Duffy
Join Date: Mar 2010
Posts: 34
Rep Power: 16
neilduffy1024 is on a distinguished road
Hi,

I have the same question. I am trying to use custom laws for devolatilization and char oxidation. I understand how to program the fuel weight loss but only where there is a single fuel stream being used (i.e. I don't know know how to do this for cofiring for example). However, I don't understand how Fluent converts weight loss in the discrete phase to a source in the gaseous phase. Is this automatically done when hooked into the custom laws or does the source have to be explicitly coded, maybe using the DEFINE_DPM_SOURCE macro. If this is the case, how is the appropriate species selected?

Any help would be appreciated.

Neil
neilduffy1024 is offline   Reply With Quote

Old   December 1, 2010, 13:39
Default
  #3
Member
 
Allan Walsh
Join Date: Mar 2009
Posts: 56
Rep Power: 17
Allan Walsh is on a distinguished road
Yes, you have to explicity update the source terms.
If you know the change in particle mass, then the source term is the change in mass multiplied by the amount of condensed phase mass represented by that particle.
I have just updated the source terms directly using the variable C_STORAGE_R(cell,thread,SV_DPMS_SPECIES). The ...SPECIES is defined for each combustion stage.
I guess there could be some advantage to using the Define source macro, but I could not think of any when I wrote my code.
Different fuel streams can have different volatiles for modeling co-firing.
It might take a month or two to modify and check a UDF for volatilization so be prepared.
Allan Walsh is offline   Reply With Quote

Old   December 2, 2010, 08:32
Default
  #4
Member
 
Neil Duffy
Join Date: Mar 2010
Posts: 34
Rep Power: 16
neilduffy1024 is on a distinguished road
Hi Allan,

Thank you very much for the reply, it was very helpful. I am struggling to follow a couple things though:
  1. Source term: I had the mass loss of volatiles (or condensed phase) in the particle = P_MASS0(p)*P_VFF(p)*k (where k is an arrhenius expression). Just like you said I think? But do I need to multiply this by the no. particles in the cell before I update the source term for that cell - if using the C_STORAGE_R macro?
  2. When you say the species is defined for each combustion stage (say CxHyOz for devol and maybe CO2 for char oxidation?), how and where did you define these? For the built in laws you could just select them at the injection display box, but if using custom laws do you have to search for the appropriate species in the UDF? Quite lost here - was trying things like string searches for "materials" within a mixture_species_loop!
Thanks again for your help.

Neil
neilduffy1024 is offline   Reply With Quote

Old   December 2, 2010, 12:17
Default
  #5
Member
 
Allan Walsh
Join Date: Mar 2009
Posts: 56
Rep Power: 17
Allan Walsh is on a distinguished road
1. For the amount of volatiles (or other species defined by that law) to be transferred to the gas phase, you can use an expression like:
(part_mass_last - part_mass_now) * (mass_all_particles_in_injection/part_init_mass).
No need to consider the number of particles, just keep summing the source for each particle to the source in the cell as you calculate the particle mass loss at each particle time step.
2. For the species, you will define a volatilizing species for each type of injection. Say one injection is coal and one is wood. Then for inject_coal, you can specify the volatilizing speces in the law panel in the injection set-up menu. And, do the same thing for the wood injection, inject_wood. Now, the C_STORAGE_R variable is an array with parameters (cell,thread,species_index). Usually for the species index, you would use an expression like .... SV_DPMS_SPECIES_0+devol_species_index, which will automatically set the integer representing the ith species index.
Look in the DPM header files for how the various variables are declared - and be prepared to do lots of checking and reverse engineering.
Allan Walsh is offline   Reply With Quote

Old   December 10, 2010, 12:33
Default
  #6
Member
 
Neil Duffy
Join Date: Mar 2010
Posts: 34
Rep Power: 16
neilduffy1024 is on a distinguished road
Hi Allan,

Thanks again for the detailed response. Very helpful and much appreciated.

Neil
neilduffy1024 is offline   Reply With Quote

Old   January 6, 2011, 10:44
Default
  #7
Member
 
Neil Duffy
Join Date: Mar 2010
Posts: 34
Rep Power: 16
neilduffy1024 is on a distinguished road
Hi Allan,

About updating the source terms directly. I have since switched to a multiphase application, modelling a fuel bed as a porous zone rather than discrete particles via an injection.

I have calculated the mass source (in kg m^-3 s^-1) for the gaseous phase and I am trying to update it directly as you mentioned before. Since I am not using the DPM I have tried the following variables:

  1. C_STORAGE_R(c,t,SV_MASS_SOURCE)
  2. C_STORAGE_R(c,t,SV_S_MASS_USER)
  3. C_STORAGE_R(c,t,SV_Y_I(i)+SV_Y_0_S-SV_Y_0)
I tried a simple single phase simulation with the first 2 and switched on species transport to try the third. The update was a simple summation within a cell loop:
C_STORAGE_R(c,t,SV_MASS_SOURCE) += Sm; (Sm is the mass source)

The UDF compiles fine and the solution can be initialised, but as soon as the calculation begins I get a ACCESS VIOLATION. It is worth noting that I have included the sg_mem.h header file (and also tried explicitly defining the relevant storage variables) and that the UDF (using a DEFINE_PROFILE for a mass dependent property) works perfectly up until I include the storage variable.

Have you had any similar experience with this or is there something extra that I am missing?

Best regards,

Neil
neilduffy1024 is offline   Reply With Quote

Old   January 6, 2011, 14:02
Default
  #8
Member
 
Allan Walsh
Join Date: Mar 2009
Posts: 56
Rep Power: 17
Allan Walsh is on a distinguished road
Neil,
If you are not using the DP model, I suspect that the C_STORAGE variables are all inactive. Fluent seems to give the Access_violation message anytime you try to access a variable that for what ever reason, you should not have access to. Allan
Allan Walsh is offline   Reply With Quote

Old   January 6, 2011, 15:40
Default
  #9
Member
 
Neil Duffy
Join Date: Mar 2010
Posts: 34
Rep Power: 16
neilduffy1024 is on a distinguished road
Hi Allan,

Yeah that would explain it alright, but I have seen the C_STORAGE used in non DPM examples within the UDF manual which made me think otherwise. It's quite difficult to know what will work and when from looking at the header files.

By any chance have you directly updated any variables outside a DP simulation? I have pushed on with a DEFINE_SOURCE UDF instead but the computational expense is significant so the direct method would be preferred if possible.

Thanks again,

Neil
neilduffy1024 is offline   Reply With Quote

Old   November 6, 2012, 07:40
Default
  #10
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 16
Kanarya is on a distinguished road
Quote:
Originally Posted by neilduffy1024 View Post
Hi Allan,

Yeah that would explain it alright, but I have seen the C_STORAGE used in non DPM examples within the UDF manual which made me think otherwise. It's quite difficult to know what will work and when from looking at the header files.

By any chance have you directly updated any variables outside a DP simulation? I have pushed on with a DEFINE_SOURCE UDF instead but the computational expense is significant so the direct method would be preferred if possible.

Thanks again,

Neil
Hello,

Did you implement Kobayashi model? Can you give me some example with DEFINE_SOURCE for devolatilization.

Thanks in advance!
Kanarya is offline   Reply With Quote

Old   July 1, 2013, 09:47
Default
  #11
New Member
 
jieyu
Join Date: Jul 2013
Posts: 20
Rep Power: 13
onlylno is on a distinguished road
Quote:
Originally Posted by Kanarya View Post
Hello,

Did you implement Kobayashi model? Can you give me some example with DEFINE_SOURCE for devolatilization.

Thanks in advance!
DO you solve you probem?
onlylno is offline   Reply With Quote

Old   July 1, 2013, 10:26
Default
  #12
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 16
Kanarya is on a distinguished road
hi
yes, I solve it!
with mass_transfer
Quote:
Originally Posted by onlylno View Post
DO you solve you probem?
Kanarya is offline   Reply With Quote

Old   October 24, 2013, 05:04
Default
  #13
New Member
 
jieyu
Join Date: Jul 2013
Posts: 20
Rep Power: 13
onlylno is on a distinguished road
Quote:
Originally Posted by Kanarya View Post
hi
yes, I solve it!
with mass_transfer
Can you share some examples? I want to wirte coal devolatilization.
yujiehust@hotmail.com
Thanks in advance!
onlylno is offline   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
UDF for devolatilization chinadai Fluent UDF and Scheme Programming 7 July 1, 2013 09:42
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 22:38
How to rewrite devolatilization by UDF studyudf Fluent UDF and Scheme Programming 0 April 23, 2009 05:17
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 16:42.