CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Fixed Bed Gasifier, Species Transport Problem (

therandomestname November 29, 2010 19:26

Fixed Bed Gasifier, Species Transport Problem
My project is to simulate a very simple fixed bed wood gasifier and do a parametric study. I am having a problem with the species transport model.

I have defined the fuel bed as a porous zone and specified the material as wood. I turn on the species transport model, and enable surface reactions. I would like to set up various surface reactions with the char. However, the program will not let me add wood as a solid specie in my mixture. In the materials dialog, I click on my mixture name, Create/Edit, Mixture Species Edit, and the dialog box comes up to add the species to the mixture. None of the solid species I have selected are available to be added. Does anybody know what the problem could be? This is my first project with FLUENT so it could be a very basic error.

Also, sometimes I save my case file, and when it reloads I am only able to able to edit under General and Materials. Does anybody know what is causing this? Could just be a network problem.

Is it possible to use the DPM model to simulate a stationary bed of particles? If so, how?

VT_Bromley November 29, 2010 22:12

I believe the answer to your problem is:

"ANSY FLUENT's Eulerian multiphase model does not distinguish between fluid-fluid and fluid-solid (granular) multiphase flows. A granular flow is simply one that involves at least one phase that has been designated as the granular phase."

That is taken from the theory guide. Basically you will create the wood as a liquid under materials. Then when you specify the phase you will be able to select granular. The only property that matters under the materials when using it as your granular phase is the density.

I hope that helps.

srr November 30, 2010 00:26

Euler granular provides a good aproximation to that problem, but you must write an UDF for heterogeneous reactions

coalgas November 30, 2010 00:50

Yes, john,

Euler -granular Approach is useful while modelling fixed bed gasification process. You need to use DEFINE_HET_RXN_RATE macro to define your heterogeneous reactions and define it in phase interaction panel.

therandomestname December 13, 2010 16:13

Thank you this was very helpful!

Another question:

I am starting to write my UDFs. I have found the define_het_rxn_rate macros. I am confused about how to specify which species you are retrieving data for. How do you know which species ID number corresponds to which species?

I have to define a couple homogeneous reaction rates too:


If I want to find the y of oxygen, I would put yi[g], but how do i determine which number g is? Does it depend on the order of species in the mixture species list?

neilduffy1024 April 21, 2011 12:29

Hi John,

To find the species no. go to Materials -> Create/Edit the mixture in question -> Within the properties dialog box, beside "mixture species", click Edit. The list of species here will give you the individual species no. The species on top is species 0 and they increase incrementally from top to bottom.

On a different note, when using the Define_het_rxn_rate, is there a built in method for including the heat of reaction or is it necessary to include a define source UDF for both phases (equal but opposite)? In which case, what advantage is there to using define_het_rxn_rate instead of a define_vr_rate of even a define_mass_transfer? Especially considering that the required units are kmol/m^3 s which seems odd for solid fuel combustion.


therandomestname April 21, 2011 14:48

Thank you all, I am getting very close to some kind of a solution.

However, I am having a problem. I am able to hook my het_rxn_rate udfs into fluent and converge a solution with these running. However, FLUENT will not run my mass transfer UDFs. They compile, I set up the mass transfer in the phase interaction panel and select my UDF names for the rate, but for some reason when I run the calculation I do not see any residual for the species I am mass transfering to (CO and CO2) and when I get my solution the mass fraction of these species is 0. Also, every time I go back to the phase interaction panel, the rate of the mass transfer is still listed as user defined, but the name of my UDFs is not shown in the box. Is this a problem with the UDF (i.e. the number out is equal to 0, though this seems unlikely since it is a relatively simple UDF) or am i just setting up something incorrectly in the interface?



I have also been wondering how FLUENT specifies heat of reactions. The only thing I can figure out is that it does it by the enthalpies you enter under material properties.

As for the Het_rxn vs. mass transfer question:

I think the main difference with reaction vs. mass transfer is that in a reaction it allows you to have mass transfer from more than one species (your reactants). As you probably can tell from my question above, I am not having trouble with the het_rxn udfs but I AM having a lot of trouble with the mass transfer udfs. I am no expert, but based on my experience go with the het_rxn macro.

neilduffy1024 April 26, 2011 10:48

fixed bed simulation approach and UDFs
Hi John,

Cheers, that makes sense for the het_rxn UDF. It seems like it must determine the heat of reaction from the reference enthalpies alright, which is a pain for doing energy balance calcs for fuels like wood! Can anyone confirm this?

As the DEFINE_HET_RXN_RATE supposedly includes mass transfer, what are your mass transfer UDFs for? Also, one thing that is not clear to me is whether you are using:

  1. A porous zone approach, i.e. a single-phase simulation (well, as far as Fluent treats it) with wood specified as the solid material in the porous zone. You could then assume a continuous feed of fuel (the porosity would not change) and simulation combustion using mass sources to the gas phase, using DEFINE_SOURCE. This seems to be what you originally proposed?
  2. Using the Eulerian/Eulerian (granular) approach, with wood specified as a pseudo fluid and then selected as the second (granular) phase. Which seems to be what you are doing now with the DEFINE_HET_RXN_RATE??


therandomestname April 26, 2011 15:55


I am using the 2nd method you described. Euler-euler with wood as a granular phase. I solved the mass transfer problem, I had the density defined wrong so it was smaller than the air. this caused suction, and my reversed flow.

However, I am still getting nonsense results. although my mass transfer and reaction rates are quite high (300 or so kg/m^3-s), i am getting very low concentrations of the mass transfer and het rxn products (CO and CO2 have been coming out with mass fractions at like 10^-4). also, the mass fractions are only altered in my fuel bed. in the fluid zone at the top of the reactor the mass fractions of everything except oxygen and nitrogen return to 0. any idea why this could be?

the Fluent theory guide says this about mass transfer:

Note that when using this UDF,
ANSYS FLUENT will automatically
add the source contribution to all relevant momentum and scalar equations.
This contribution is based on the assumption that the mass “created” or “destroyed”
will have the same momentum and energy of the phase from which it was created or

Since I am using a packed bed does this mean that the mass added to my fluid phase has a momentum of 0? this could explain some of my problems. however, another thing i was confused about was that I was still getting non zero phase 2 velocities even though i checked the packed bed option, which counters this theory...

therandomestname April 26, 2011 17:40


I am considering changing my setup to avoid the multiphase model. How can i implement a define_source UDF for species? the only way I can find to implement it is at the boundary conditions and I need to have the source throughout my fuel bed.

neilduffy1024 April 27, 2011 09:47

Hi John,

I think I misunderstood you when you mentioned mass transfer before. Have you just used the het_rnx and specified the relevant species in the interaction panel or have you written seperarate mass transfer UDFs?

Regarding the mass source. This is implemented in ->cell zone conditions -> edit zone. You will can then select source terms and hook your udf into it here.

Below is a simple source UDF I used for a porous zone with changing porosity, mass source gas = porosity change x density solid. Beware if using for transient, because it implements the source on each iteration, not timestep. On a side note: if you intend to change the porosity during the simulation, this causes a bug within Fluent V12.1, as it is impossible to maintain a mass balance when the porosity changes.

DEFINE_SOURCE(Mass_Source_porous_zone, c, t, dS, eqn)
real source; /*mass source*/
real x[ND_ND];
real den = 2719.0; /*kg m^-3 taken directly from material properties as it remains constant in this case*/
real PorNew;
real PorOld;
real vol;
int curr_ts; /*number of current timestep*/
int curr_iter; /*number of iteration*/
PorNew = C_UDMI(c,t,0); /*porosity values stored from a separate UDF*/
PorOld = C_UDMI(c,t,1);
curr_iter = N_ITER;
curr_ts = N_TIME;
vol = C_VOLUME(c,t);

if (first_iteration)
source = den*(PorNew - PorOld)/ts;
dS[eqn] = 0.0;
source = 0.0;
dS[eqn] = 0.0;
C_UDMI(c,t,2)= source; /*will then be able to display the mass source in the GUI as User Defined Memory can be displayed+*/

return source;

As for your problems with the multiphase approach, I'm not really sure what might be the issue because I am not familiar with that approach and am just trying to figure it out myself. I'm even having trouble gettin my het_rxn UDF to run without divergence, even after messing with the rate. What UDFs did you use?

At a guess, I would say that the mass fraction issue could be due in part to the packed bed. However, once transferred to phase 1, the species should no longer be constrained! strange. One way of overcoming the initial momentum issue would be using a DEFINE_SOURCE UDF (like above) but for momentum of the required species, CO for instance. This would be hooked in exactly the same way as the mass source UDF.


calvin May 8, 2011 09:20

hi fellas,
i am facing a persistent problem in fluent on linux platform
i am able to compile my udfs on linux successfully but my uds source udf doesnt show up in the source panel and hence i am not able to hook it
this problem does not occur in windows platform
pl help me

All times are GMT -4. The time now is 20:03.