Dear Georg,

when you set Dirichlet boundary conditions the equation gets replaced by the Dirichlet boundary condition. I think that's what's clear. When you set Neumann boundary conditions in Dumux you set a value for the entire flux term (advective + diffusive part). So when you set a "no-flow" flow condition meaning you set the values in the neumann boundary function to zero you really get no flow over the boundary -> F(advective + diffusive)*n = 0. If you set it to a value, you set the whole flux to that value.

If I understood correctly, this is NOT what you want to do in your example. You want to set either the diffusive (something like grad c * n = 0) or the advective (something like grad p * n = 0) part to zero and keep the other part. This is unfortunately not possible conveniently. What you have to do is to use the function solDependentNeumann(). In that function (you probably know the function) you have the current element volume variables at hand. So, if you want to set the diffusive flux to zero, you calculate the advective flux in the solDependentNeumann function -> the total flux gets replaced by the advective flux. The same works of course the other way around. You basically calculate the local residual inside the solDependentNeumann function, leaving out either the advective or the diffusive flux. Note that the values obtained from the solDependentNeumann function get multiplied with the face area during assembly, so you don't have to / shouldn't do that in the function already.

I hope this works out for you.

Timo

On 08/11/2015 02:50 PM, georg.fut...@dlr.de wrote:

Hello Dumux,

I am still struggling with the boundary conditions for my system. What I want to do for the cathode side of my fuel cell model is depicted in Figure1.jpg. I want to simulate a fuel cell along one gas channel. I use the mpnc model with a 2p3c-fluidsystem. On the inlet, gas is fed to the fuel cell which may react along the channel. In the electrochemical reaction, O2 of the feed gas is consumed and H2O is produced. If the current that is produced in the cell is high enough, liquid water will be formed and transported to the outlet.

What I know is:

1.the total gas flux that goes into the system (depends on the current)

2.The gas phase composition at the inlet ( all mole fractions)

3.The saturation at the inlet (S_g =1)

4.the total flux that goes out of the system (I can calculate that because I know the sources and sinks for H2O and O2 (see below))

5.the gas pressure at the outlet

What I want to determine from the Simulation:

1.the gas pressure at the inlet

2.the saturation at the outlet

For the boundary conditions at the outlet, I assume the following:

1.No gravity

2.Pure advection

3.Grad(x_alpha^kappa) = 0 à no diffusion, perfect mixing

4.Grad(p_g) = grad(p_l ) = grad(p), this means grad(S_g ) = grad(S_l ) = 0

With that, the molar flux out of the system of species kappa will read:



        


                                                (1)

The flux of Oxygen out of the system can be calculated via Faradays law:



        


                                (2)

Where lambda is the stoichiometry factor for the fuel cell operation. A value of lambda = 2 means that twice as much oxygen is fed to the cell as is needed to draw the desired current and (labda-1) represents the amount of O2 that is not consumed in the reaction (the amount that goes out). Further, I is the cell current, 4 is the number of electrons which is transferred in the reaction, F is Faradays constant, A is the Area of the Channel outlet and n is the normal vector.

With that, the pressure gradient at the outlet can be calculated from (1) and (2):



        


                                (3)

Inserting (3) in (1) gives the flux of an arbitrary species at the outlet:



        


                                (4)

Now I want to set these fluxes as Neumann conditions on the outlet for the component conservation equations. Any comments/objections on that? Additionally, I want to set the pressure at the outlet using a Dirichlet condition.

For the saturation at the outlet I don’t know which type of boundary condition I can use. I don’t know the value of the saturation at the outlet so Dirichlet is not an option. Will setting a Neumann condition (values[s0Idx] = 0.0) mean that the gradient of saturation is 0? Or what will happen if I use values.setOutflow(s0Idx)?

Also, I don’t know what to do with the pressure at the inlet. Its value should be determined by the simulation so again, Dirichlet is not an option. Would setting a Neumann condition (values[p0Idx] = molarGasFluxIn) mean I set the corresponding pressure gradient?

Or could one also use an outflow condition for the pressure?

Thanks for your help

Georg

——————————————————————————

*German Aerospace Center *(DLR)

Institute of Engineering Thermodynamics | Computational Electrochemistry | Pfaffenwaldring 38-40 | 70569 Stuttgart

Dipl.-Ing. *Georg Futter* | Ph.D. student

Telefon 0711/6862-8135 | georg.fut...@dlr.de <mailto:georg.fut...@dlr.de>

www.DLR.de <http://www.dlr.de/>



_______________________________________________
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


--
____________________________________________________________________

Timo Koch                      phone: +49 711 685 64676
IWS, Universität Stuttgart     fax:   +49 711 685 60430
Pfaffenwaldring 61             email: timo.k...@iws.uni-stuttgart.de
D-70569 Stuttgart              url:   www.hydrosys.uni-stuttgart.de
____________________________________________________________________

_______________________________________________
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

Reply via email to