|
[Sponsors] |
September 26, 2014, 10:15 |
Not Working:UDF Internal Steam Reforming in Fuel Cell
|
#1 |
New Member
Kashif Rashid
Join Date: Apr 2014
Posts: 8
Rep Power: 12 |
I have written UDF in C, using fluent macro, “DEFINE_SOURCE”, for internal steam reforming (file attached). Reforming reactions are supposed to take place inside porous anode electrode of Fuel Cell. Pre-reformed fuel mixture is used which consist of (CH4, H2, H2O, CO, CO2) species. 6 source terms are generated (5 from species, 1 from heat sink, as steam reforming is an endothermic reaction). These source terms are hooked in "Cell Zone Conditions" of fluent. UDMI, memories in Fluent are also allocated to store data for above terms (see code file).
After doing all these things and running simulation, reactions are not taking place; there is no change in concentration of species at inlet and outlet. Can someone take a look on UDF and suggest me what i am doing wrong? Heat is being provided outside the porous anode to facilitate the endothermic reaction. In the next step I shall include electrochemical reactions in this UDF taking place at the surface of anode, which are exothermic. Reforming reaction reactions will use this heat. Last edited by Kashif Rashid; September 28, 2014 at 03:46. Reason: made some changes in the UDF |
|
September 26, 2014, 17:03 |
|
#2 |
Senior Member
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25 |
I think you are asking for trouble by doing the chemistry computations in the energy DEFINE_SOURCE and storing them in UDMs. The energy equation is called late in the segregated solver iteration (after the mass equation solution), so your UDMs are empty when you address them in the mass DEFINE_SOURCE, at least for the first iteration.
Computing all of your sources in one part of code makes sense. But If you do that, move those calculations to a DEFINE_ADJUST so that all of the (related) source terms are updated together at the beginning of the iteration and placed in the UDMs. Then all of the DEFINE_SOURCEs just need to read and apply the UDM data. I am not sure that this will fix your problem of not seeing any effect of the UDF. The UDF would be using lagged values of the UDMs after the first iteration, which is wrong...but it should show some effect. You can try doing a hand calculation to verify quickly to see what the typical source value should be. See if your UDMs are of the right order of magnitude. Check your units too. FLUENT expects kg/m^3/s for the mass and species source terms. |
|
September 27, 2014, 14:47 |
Modification in UDF (DEFINE_ADJUST)
|
#3 |
New Member
Kashif Rashid
Join Date: Apr 2014
Posts: 8
Rep Power: 12 |
Mr. mprinkey, I have modified UDF as you suggested by using "Define_Adjust" macro. There are variations in the mass fractions of species during simulation but after the solution converged there in no change in the composition of all the species at inlet and outlet (updated UDF attached).
Secondly, i have done hand calculations as well for initial composition of mixture, both results (hand cal. and soln. after converged) are of similar because after convergence composition is same. Units of rate and species source are right (checked). What else should be done in UDF to desire results??? Please take a look on the modified UDF and suggest possible solution, why this UDF is not working? The response/recommendations from other senior members shall also be highly appreciated. Last edited by Kashif Rashid; September 28, 2014 at 03:07. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to identify boundary cell and internal cell | dbxmcf | OpenFOAM Running, Solving & CFD | 2 | November 6, 2016 10:11 |
Journal file error | magicalmarshmallow | FLUENT | 3 | April 4, 2014 13:25 |
FvMatrix coefficients | shrina | OpenFOAM Running, Solving & CFD | 10 | October 3, 2013 15:38 |
UDF for heat source on surface instead of the whole cell zone?? | benson621 | Fluent UDF and Scheme Programming | 4 | December 8, 2011 12:54 |
Warning 097- | AB | Siemens | 6 | November 15, 2004 05:41 |