CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   fuel cell simulation in Fluent (https://www.cfd-online.com/Forums/fluent/31512-fuel-cell-simulation-fluent.html)

Huang May 21, 2003 04:23

fuel cell simulation in Fluent
 
Hi everyone, I am trying to simulate the mole fraction of the species nearby the anode of a fuel cell. The boundary conditions include the anode as porous media and fuel gas inlet flow. The species will react on the anode. Can I build up such a model using the models provided in Fluent? Should I use UDF? Thank you all!

Andrew Garrard May 21, 2003 11:04

Re: fuel cell simulation in Fluent
 
I also am working on fuel cells. Depending on exactly what you want to solve depends on what tools you need to use. I found that I had to creat 3 UDFS.

Best piece of advice I can give you is to know what equtions you are trying to solve befor you begin to build a model. If those equations are avaliabe in fluent you may not need to use a UDF.

The equations I have built a UDF for are the Butler Volmer equation and the current production.

If you would like more information I may be able to help.

rookie May 21, 2003 15:02

Re: fuel cell simulation in Fluent
 
Hello Andrew,

I work on modeling fuel cells as well. Could you give more details? e.g.Your model is two-phase or single phase? if two-phase flow, which model do you use? multiphase model or multispecies model or DPM? or something else? how do you model phase changes? Could you send me some UDFs for fuel cells?

Thank you so much!

rookie

Murali May 21, 2003 21:36

Separate User-group Fuel cell simulation
 
Guys,

I work in fuel cell modeling as well. I think we should form a usergroup or something about modeling of fuel cells to share information. I have been in this forum for quite some time and have considerable experience in CFD software. If interested in starting a separate user-group, I think we can all team together.

Please let me know.

Murali

Huang May 22, 2003 03:03

Re: Separate User-group Fuel cell simulation
 
I think it will be great if we can exchange ideas on this!

rookie May 22, 2003 09:01

Re: Separate User-group Fuel cell simulation
 
Hello Murali,

So far, found only a couple of guys working on Fuel cell in this forum. I think the simpliest method is to use email. In the mean time, I am going to develop an online fuel cell forum group, and posted on my website. But it may take a while for me to finish it.

Thank you!

Rookie

Murali May 22, 2003 13:08

Re: Separate User-group Fuel cell simulation
 
rookie,

I have seen quite a few guys appearing in the forum with fuel cell interests. A user forum would be great too. I thought we could start something immediately so that we may not lose the people who are currently visiting. Once u start your forum, this yahoo group can be merged with yours. Does that sound ok to you ?

Murali

http://groups.yahoo.com/group/fuel_cells/

chino September 6, 2013 20:52

A have a question?
 
Quote:

Originally Posted by Andrew Garrard
;106103
I also am working on fuel cells. Depending on exactly what you want to solve depends on what tools you need to use. I found that I had to creat 3 UDFS.

Best piece of advice I can give you is to know what equtions you are trying to solve befor you begin to build a model. If those equations are avaliabe in fluent you may not need to use a UDF.

The equations I have built a UDF for are the Butler Volmer equation and the current production.

If you would like more information I may be able to help.

Hi, sorry but a need to do a little question about the Butler-Volmer UDF. Can you help me?

A CFD free user September 8, 2013 12:03

@Chino
Hey mate, What's your problem? Tell me I will do my best to answer it.
Good luck

chino September 8, 2013 16:05

Well, I don't know how I can apply the Bultler-Volmer equation, in some articles I have found some variables that I need.
The problem is with the local reactive concentration and the temperature in the microfluidic fuel cell, because I donīt know how this variable can be writing in the UDF Bultler-Volmer equation? The two variables are results of my simulation.
The reactions in the anode a cathode has been achieved using "species transport" model, it is an isotermic reactions.

It is difficult to explain, but I am very graveful with your help.

chino September 8, 2013 16:07

Hi again.
 
1 Attachment(s)
Well, I don't know how I can apply the Bultler-Volmer equation, in some articles I have found some variables that I need.
The problem is with the local reactive concentration and the temperature in the microfluidic fuel cell, because I donīt know how this variable can be writing in the UDF Bultler-Volmer equation? The two variables are results of my simulation.
The reactions in the anode a cathode has been achieved using "species transport" model, it is an isotermic reactions.

It is difficult to explain, but I am very graveful with your help.

A CFD free user September 9, 2013 09:51

@ Chino
Hi
You should accept that you didn't ask your question exactly. It's quite vague and difficult to understand your mean. But, I suppose that you've probably have difficulty in recalling local temperature and concentration. Right? If so, you can recall them easily in the UDF by corresponding macro. For instance, you can recall temperature with C_T(c,t) or mass fractions of involved species by C_YI(c,t,i). That's my grasp of what you asked. Hope it helps
Good luck

pmtgt September 10, 2013 12:35

Hi,

I am also having a problem modelling the Butler-Volmer equation in an attempt to create an alternative model to the one provided by Ansys in fluent. I'm basically not getting the same results as the oficial model.

I have set up a 2D fuel cell model and started by trying to solve the solid and membrane potentials as UDS equations with source terms in the catalyst layers based on the transfer current given by the overpotential (as the fluent manual tells you). I've set the value of the electric potential to 0.75 at the cathode terminal/wall and 0 at the anode and have zero flux BCs for all external walls.
I've made the electron conductivity very low for the membrane and very high everywhere else and the reverse for the proton conductivity.

I have 4 source terms, in the anode side I have Ra_plus for the positive electric potential and Ra_minus for the negative protonic potential which is the same magnitude but opposite sign. A similar situation occurs on the cathode side I have Rc_minus for the electric and Rc_plus for the protonic potentials.

Like any good programmer I've copied most of the code from the pem.c udf provided with fluent but edited out the bits I don't need yet like the concentrations. A section of the listing for Ra_plus is below. The others follow the same pattern with signs changed accordingly and for the cathode side I subtract the open circuit voltage from the overpotential.

/* UDF to calculate overpotential using two electric potential fields defined as uds and transfer current source */
#include "udf.h"
#define TINY 1.0e-16
#define Farad 9.65e7
#define alpha_c 0.512
#define alpha_a 0.5
#define i_ref_a 100000
#define i_ref_c 100
#define v_oc 1.01
DEFINE_SOURCE(Ra_plus, c, t, dS, eqn)
{
/* Assign the UDS index numbers */
enum /* user-defined scalar (UDS) */
{
phi_s, /* solid phase potential */
phi_m, /* membrane phase potential */
n_uds_required
};
enum /* user-defined memory (UDM) */
{
surf_eta, /* 6 overpotential */
trans_current, /*13 transfer current A/m3 */
n_udm_required
};
/* Set overpotential as difference in two potential fields */
real source=0.0;
real c_c = 0.2;
real c_w = MAX(c_c,TINY);
real eta = C_UDSI(c,t,phi_s)-C_UDSI(c,t,phi_m);
real A_p=0.0;
real sat = 0.0;
real s_corr = 1.0;
real gamma = 1.0;
int i=0;
int n_electrons=2;
real alpha_eta_a, alpha_eta_c, exp_a, exp_c;
const real exponent_limit = 25.;
const real exp_big = exp(exponent_limit);
const real exp_sml = 0.;
const real eta_cut = 1.0e-10;

/* prevent over- and underflow of exp() */
alpha_eta_c = alpha_c*eta;
if (exponent_limit < alpha_eta_c)
exp_c = exp_big;
else if (-exponent_limit > alpha_eta_c)
exp_c = exp_sml;
else
exp_c = exp(alpha_eta_c);
/* prevent over- and underflow of exp() */
alpha_eta_a = alpha_a*eta;
if (exponent_limit < alpha_eta_a)
exp_a = exp_big;
else if (-exponent_limit > alpha_eta_a)
exp_a = exp_sml;
else
exp_a = exp(alpha_eta_a);

A_p = i_ref_a*(exp_a-exp_c)/(Farad*n_electrons);
C_UDMI(c,t,surf_eta) = eta;

dS[eqn]=(alpha_a*exp(alpha_eta_a)-alpha_c*exp(alpha_eta_c))*i_ref_a*pow(c_w,gamma)*s _corr; /*anode*/
//dS[eqn]=(alpha_c*exp(alpha_eta_c)-alpha_a*exp(alpha_eta_c))*i_ref_c*pow(c_w,gamma)*s _corr; /*cathode*/

source=A_p*n_electrons*Farad*pow(c_w,gamma)*s_corr ;
return source;

}

If anyone is willing to help I can send them images and the case and udf files

Kind regards

Tom

chino September 11, 2013 12:13

Thank you
 
Quote:

Originally Posted by A CFD free user (Post 450681)
@ Chino
Hi
You should accept that you didn't ask your question exactly. It's quite vague and difficult to understand your mean. But, I suppose that you've probably have difficulty in recalling local temperature and concentration. Right? If so, you can recall them easily in the UDF by corresponding macro. For instance, you can recall temperature with C_T(c,t) or mass fractions of involved species by C_YI(c,t,i). That's my grasp of what you asked. Hope it helps
Good luck

I will do my best to resolve my problem in this month. You answer my question, I answer if it is possible that you can look at my UDF when I finish it?

A CFD free user September 11, 2013 13:49

@ Chino
why not. I will see like others and do my best to help you. Share it on this page whenever you complete it.
Good luck

chino September 12, 2013 12:10

1 Attachment(s)
Quote:

Originally Posted by A CFD free user (Post 451193)
@ Chino
why not. I will see like others and do my best to help you. Share it on this page whenever you complete it.
Good luck

Well I send you the Butler-Volmer equation for the anodic reaction, I never do a program in C lenguage so I will have some problem with the redaction. One more time, thank you for your help.

wuyujing November 26, 2020 07:49

Quote:

Originally Posted by A CFD free user (Post 450511)
@Chino
Hey mate, What's your problem? Tell me I will do my best to answer it.
Good luck

Hi
I'm modeling DMFC, and i need to write a udf, but i don't know how to define Butler-Volmer equation. I saw overpotential defined by UDS in many paper, Is current density defined in UDS source macro or in adjust macro? please help me!

AlexanderZ November 26, 2020 18:39

you need to use user defined scalar (UDS) to calculate Butler-Volmer equation.

adjust macro is just a macro to be executed before each iteration/time step

read ansys fluent customization manual for more information


All times are GMT -4. The time now is 19:29.