How to rewrite devolatilization by UDF
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?
|
Custom law UDF
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 |
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. |
Hi Allan,
Thank you very much for the reply, it was very helpful. I am struggling to follow a couple things though:
Neil |
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. |
Hi Allan,
Thanks again for the detailed response. Very helpful and much appreciated. Neil |
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 |
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 |
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 |
Quote:
Did you implement Kobayashi model? Can you give me some example with DEFINE_SOURCE for devolatilization. Thanks in advance! |
Quote:
|
hi
yes, I solve it! with mass_transfer Quote:
|
Quote:
yujiehust@hotmail.com Thanks in advance! |
All times are GMT -4. The time now is 16:59. |