|
[Sponsors] |
April 23, 2009, 05:18 |
How to rewrite devolatilization by UDF
|
#1 |
New Member
studyudf
Join Date: Apr 2009
Posts: 2
Rep Power: 0 |
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?
|
|
November 30, 2010, 06:42 |
Custom law UDF
|
#2 |
Member
Neil Duffy
Join Date: Mar 2010
Posts: 34
Rep Power: 16 |
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 |
|
December 1, 2010, 13:39 |
|
#3 |
Member
Allan Walsh
Join Date: Mar 2009
Posts: 56
Rep Power: 17 |
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. |
|
December 2, 2010, 08:32 |
|
#4 |
Member
Neil Duffy
Join Date: Mar 2010
Posts: 34
Rep Power: 16 |
Hi Allan,
Thank you very much for the reply, it was very helpful. I am struggling to follow a couple things though:
Neil |
|
December 2, 2010, 12:17 |
|
#5 |
Member
Allan Walsh
Join Date: Mar 2009
Posts: 56
Rep Power: 17 |
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. |
|
December 10, 2010, 12:33 |
|
#6 |
Member
Neil Duffy
Join Date: Mar 2010
Posts: 34
Rep Power: 16 |
Hi Allan,
Thanks again for the detailed response. Very helpful and much appreciated. Neil |
|
January 6, 2011, 10:44 |
|
#7 |
Member
Neil Duffy
Join Date: Mar 2010
Posts: 34
Rep Power: 16 |
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:
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 |
|
January 6, 2011, 14:02 |
|
#8 |
Member
Allan Walsh
Join Date: Mar 2009
Posts: 56
Rep Power: 17 |
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 |
|
January 6, 2011, 15:40 |
|
#9 |
Member
Neil Duffy
Join Date: Mar 2010
Posts: 34
Rep Power: 16 |
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 |
|
November 6, 2012, 07:40 |
|
#10 | |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
Quote:
Did you implement Kobayashi model? Can you give me some example with DEFINE_SOURCE for devolatilization. Thanks in advance! |
||
July 1, 2013, 09:47 |
|
#11 |
New Member
jieyu
Join Date: Jul 2013
Posts: 20
Rep Power: 13 |
||
July 1, 2013, 10:26 |
|
#12 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 16 |
||
October 24, 2013, 05:04 |
|
#13 |
New Member
jieyu
Join Date: Jul 2013
Posts: 20
Rep Power: 13 |
Can you share some examples? I want to wirte coal devolatilization.
yujiehust@hotmail.com Thanks in advance! |
|
|
|
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 |