Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Concentration PDE / solver

Please login with a confirmed email address before reporting spam

Hi,

I have query regarding a COMSOL simulation I am running.

I am modelling an electrochemistry problem. I am solving for a concentration using a coefficient form PDE. I am essentially solving FIck's law of diffusion. My concentration is in Mol/m3. I have set the source term unit to molar flux (mol/m2/s)

I have a flux/source boundary condition where I impose a flux (mol/m2/s) and get a solution that matches my expectations - I have performed validation using volume integral of concentration and am getting the flux into the domain that I hoped for.

The first query I have is that the flux/source entry is in (mol/m2/s) but is expected to be in mol/m/s. My unit is wrong by a metre. I am also using a diffusion coefficient - units are m2/s as normal - but COMSOL is looking for m3/s so out by a metre again. What should I be using for the pde units?

I am actually solving two concentrations (oxygen and hydroxide). Oxygen is converted to hydroxide at one electrode and hydroxide is converted to oxygen at the other. However, we can’t make hydroxide if all the oxygen is depleted. If I use if(oxygen concentration > 0, reaction rate, 0) at the flux/source term then I get an extremely small timestep / really long solution time. Is there a way to speed this up at all? Smarter boundary condition or non standard solver?

Any advice would be appreciated.

Tim

4 Replies Last Post 18 juil. 2017, 08:46 UTC−4
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 17 juil. 2017, 10:10 UTC−4
Tim,
Could it be that you are working in 2D?
Jeff
Tim, Could it be that you are working in 2D? Jeff

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 17 juil. 2017, 10:13 UTC−4
Hi Jeff,
Definitely a 3D model.
Tim.
Hi Jeff, Definitely a 3D model. Tim.

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 17 juil. 2017, 15:41 UTC−4
Updated: 7 years ago 17 juil. 2017, 15:45 UTC−4
Hi again Tim,
You wrote that you set the source term to be molar flux (Mol/m^2/s). Did you perhaps mean to set it to a reaction rate (Mol/m^3/s)?
Jeff

PS: Reading between the lines, I am guessing that your license does not include the Chemical Reaction Engineering Module. Note that if you added that module you would have available to you right out of the box the convection-diffusion-reaction equation for multiple species (which you appear to be trying to implement on your own using the coefficient form PDE interface).
Hi again Tim, You wrote that you set the source term to be molar flux (Mol/m^2/s). Did you perhaps mean to set it to a reaction rate (Mol/m^3/s)? Jeff PS: Reading between the lines, I am guessing that your license does not include the Chemical Reaction Engineering Module. Note that if you added that module you would have available to you right out of the box the convection-diffusion-reaction equation for multiple species (which you appear to be trying to implement on your own using the coefficient form PDE interface).

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 18 juil. 2017, 08:46 UTC−4
Hi Jeff,

Switching the source term unit to reaction rate has sorted the unit mismatch out - many thanks for this.

I do still have issues with crushingly long solution times though.

You are correct with the assumption that I don't have access to the chemical reaction module. We have most but not all modules in our licence. We got a quote for upgrading which had more zeros than the Japanese air force so have been asked to try to build the model using the PDE interface....

I'm also very new to COMSOL - I would be happier using/writing a Finite Volume code to solve this. Is there a way to interact with the solver through a user function? Loop through all cells, identify those with a face on a specified boundary and manipulate the solved variable with my own function? Would this be possible with livelink?

I really appreciate your help

Tim.
Hi Jeff, Switching the source term unit to reaction rate has sorted the unit mismatch out - many thanks for this. I do still have issues with crushingly long solution times though. You are correct with the assumption that I don't have access to the chemical reaction module. We have most but not all modules in our licence. We got a quote for upgrading which had more zeros than the Japanese air force so have been asked to try to build the model using the PDE interface.... I'm also very new to COMSOL - I would be happier using/writing a Finite Volume code to solve this. Is there a way to interact with the solver through a user function? Loop through all cells, identify those with a face on a specified boundary and manipulate the solved variable with my own function? Would this be possible with livelink? I really appreciate your help Tim.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.