Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Bug in mixture averaged diffusion model

Please login with a confirmed email address before reporting spam

Hello Everyone,
I like to share my finding of bug in mixture averaged diffusion model in Comsol 4.2. This model finds the diffusivity of component in a mixture using the equation,

Di,m= (1-wi)/(Sum(xk/Dik))

where, wi = mass fraction of component i
xk = mole fraction of component k
Di,m=component i diffusivity in mixture
Dik=component i diffusivity in component k

Now, Comsol can calculate this diffusivity correctly for all other components except for the last component which concentration is gonna be calculated based on mass constraint. For this component Comsol use following equation,
Di,m = 1/(Sum(xk/Dik)), so instead of 1-wi, Comsol considers 1, but my understanding is that Comsol should use

1-wi=1-(1-sum(all other component)) = sum(all other component), so the above equation for the last component should be

Di,m = sum(all other component)/(Sum(xk/Dik))

this changes won't make huge changes where diffusion's role is not important..nevertheless Comsol should use correct mathematics and equation.

Let me know if there is any problem in understanding the description..
Cheers
Mayur






6 Replies Last Post 5 gen 2012, 12:41 GMT-5
COMSOL Moderator

Hello Mayur

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 3 gen 2012, 22:31 GMT-5
Hi,
I have questions about the mixture-averaged diffusion model in COMSOL. Is this model only available for gases? Can it be applied to liquids? And what about the Maxwell-Stefan model in COMSOL? Thank you!



Hello Everyone,
I like to share my finding of bug in mixture averaged diffusion model in Comsol 4.2. This model finds the diffusivity of component in a mixture using the equation,

Di,m= (1-wi)/(Sum(xk/Dik))

where, wi = mass fraction of component i
xk = mole fraction of component k
Di,m=component i diffusivity in mixture
Dik=component i diffusivity in component k

Now, Comsol can calculate this diffusivity correctly for all other components except for the last component which concentration is gonna be calculated based on mass constraint. For this component Comsol use following equation,
Di,m = 1/(Sum(xk/Dik)), so instead of 1-wi, Comsol considers 1, but my understanding is that Comsol should use

1-wi=1-(1-sum(all other component)) = sum(all other component), so the above equation for the last component should be

Di,m = sum(all other component)/(Sum(xk/Dik))

this changes won't make huge changes where diffusion's role is not important..nevertheless Comsol should use correct mathematics and equation.

Let me know if there is any problem in understanding the description..
Cheers
Mayur


Hi, I have questions about the mixture-averaged diffusion model in COMSOL. Is this model only available for gases? Can it be applied to liquids? And what about the Maxwell-Stefan model in COMSOL? Thank you! [QUOTE] Hello Everyone, I like to share my finding of bug in mixture averaged diffusion model in Comsol 4.2. This model finds the diffusivity of component in a mixture using the equation, Di,m= (1-wi)/(Sum(xk/Dik)) where, wi = mass fraction of component i xk = mole fraction of component k Di,m=component i diffusivity in mixture Dik=component i diffusivity in component k Now, Comsol can calculate this diffusivity correctly for all other components except for the last component which concentration is gonna be calculated based on mass constraint. For this component Comsol use following equation, Di,m = 1/(Sum(xk/Dik)), so instead of 1-wi, Comsol considers 1, but my understanding is that Comsol should use 1-wi=1-(1-sum(all other component)) = sum(all other component), so the above equation for the last component should be Di,m = sum(all other component)/(Sum(xk/Dik)) this changes won't make huge changes where diffusion's role is not important..nevertheless Comsol should use correct mathematics and equation. Let me know if there is any problem in understanding the description.. Cheers Mayur [/QUOTE]

Nagi Elabbasi Facebook Reality Labs

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 3 gen 2012, 23:39 GMT-5
According to the documentation w_Q (mass fraction of last component) = 1 – sum (w_i), so calculation of D_i_m should be ok.
According to the documentation w_Q (mass fraction of last component) = 1 – sum (w_i), so calculation of D_i_m should be ok.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 5 gen 2012, 10:19 GMT-5
it was wrong previously, they corrected in the latest release, but there is one more bug abt diffusion flux of last component, which should be non zero but comsol calculating it zero..
it was wrong previously, they corrected in the latest release, but there is one more bug abt diffusion flux of last component, which should be non zero but comsol calculating it zero..

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 5 gen 2012, 10:24 GMT-5
Hi

in case of doubts about "bugs" the best is to ask "support" directly, as they are the only one knowing fully the COMSOL "internals"

--
Good luck
Ivar
Hi in case of doubts about "bugs" the best is to ask "support" directly, as they are the only one knowing fully the COMSOL "internals" -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 5 gen 2012, 10:46 GMT-5
Its easy to check comsol internal, and i reported this bug to comsol, they just want to do business and don't care about implementing mathematical equations properly.
Its easy to check comsol internal, and i reported this bug to comsol, they just want to do business and don't care about implementing mathematical equations properly.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 5 gen 2012, 12:41 GMT-5
Hi

Well my experience (30+ years with use of advanced computer software) with COMSOL we have some of the most positively reactive enginners and scientists I have met so far.
Bugs and errors are always possible, not only with software, twice the same error is annoying, more is, I agree, bad.
So far, the very few bugs I have discovered over the last years with COMSOL were all corrected rapidly in next patch. Furthermore, if you look at the extent of what COMSOL does, there are few if even any software out there, that have that many mixing of physics.

y the way perhaps its already corrected in the 4.2a (.166), have you checked ?

So for me "bugs" or misbehaviour are to be reported to the developpers at "support", and for us users its nice to be warned and to know the work-arounds

--
Have fun COMSOling
Ivar
Hi Well my experience (30+ years with use of advanced computer software) with COMSOL we have some of the most positively reactive enginners and scientists I have met so far. Bugs and errors are always possible, not only with software, twice the same error is annoying, more is, I agree, bad. So far, the very few bugs I have discovered over the last years with COMSOL were all corrected rapidly in next patch. Furthermore, if you look at the extent of what COMSOL does, there are few if even any software out there, that have that many mixing of physics. y the way perhaps its already corrected in the 4.2a (.166), have you checked ? So for me "bugs" or misbehaviour are to be reported to the developpers at "support", and for us users its nice to be warned and to know the work-arounds -- Have fun COMSOling Ivar

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.