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.

Upwinding, streamline diffusion and cross wind diffusion.

Please login with a confirmed email address before reporting spam

Can anyone point me to a general discussion, complete with a detailed description, of upwinding, streamline and cross wind diffusion and how they are implemented using the COMSOL functions? I'm not interested in just the code, but a detailed derivation and rationale for why it's written as it is. In general, one would like to be able to implement the equivalent of various expressions that are easy to write in FDTD form but seem to be rather complex in FEM. I finally figured out how to manually convert the PDE (strong) form to weak form, but functions like test(), up(), down() ,and parameters like dnx, udy, etc. are not clearly described in COMSOL documention, nor is there a detailed description of the relationhships between various functions and the underlying shape functions, differences between shlag, shdisc, shdiv, shcurl, etc. shape functions and exactly how functions calls are evaluated within a cell for shape functions.

What I'd like is the general procedures necessary to to implement in weak form something like the (3, -4, 1)/2 three point formula for computing first derivatives (as opposed to the (-1, 0, 1)/2 centered form, which allows one to compute the normal component of a first derivative at a boundary, among other things. I've looked at the upwinding and streamline diffusion examples where they are included in various model library modules, but why they are what they are is a complete mystery to me. In general the discussion of weak and ultraweak forms is too abstract in the documentation, and is lacking a detailed discussion, with figures and arrows, to be of much practical use.

It would be helpful if there existed some documentation of a tutorial type that explains these and other examples, not just in terms of buttons to push, but with detailed explanations of the undelying concepts, including even how to design and implement one's own shape functions. Someone, somewhere had to design the shape functions and routines to take derivatives in COMSOL, but I have not been able to find such information.

Any info anyone has on this would be greatly appreciated. Thx.

BTW, I just bought the new book "Multiphysics Modeling Using Comsol: A First Principles Approach" by Roger W. Pryor. The book is a cut and past of screen shots and the accompanying text spells out, in exhaustive detail, every single key stroke and button to push to set up and run rather elementary examples. It tells you "how", and in excessive detail at that, but nowhere is there a "why." I bought the book hoping that it would contain some information pertaining to my questions above, but there was absolutely nothing. The term "Shape function" isn't even mentioned in the book (neither is it in the index) except as one of the things one has to select in a model. The same for "weak" and "ultraweak" stuff. Not helpful whatsoever.

7 Replies Last Post 14 avr. 2010, 01:49 UTC−4
COMSOL Moderator

Hello Davis Sentman

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 13 avr. 2010, 10:35 UTC−4
I second much of Mr. Sentman's sentiments regarding the lack of help in the manuals regarding formulating weak statements using the PDE modes and the lack of transparency in the formalism and implementaion of artificial diffusion in COMSOL. I've yet to find what the weak contributions 'gls' and 'shock_capt' are actually doing behind the scenes (found in the weakly compressible, non-isothermal NS modeule's equation system>subdomain settings >weak tab, for example). Overall, there should be more transparency and clarity to the description of how the individual modules and PDE modes are setup.
I second much of Mr. Sentman's sentiments regarding the lack of help in the manuals regarding formulating weak statements using the PDE modes and the lack of transparency in the formalism and implementaion of artificial diffusion in COMSOL. I've yet to find what the weak contributions 'gls' and 'shock_capt' are actually doing behind the scenes (found in the weakly compressible, non-isothermal NS modeule's equation system>subdomain settings >weak tab, for example). Overall, there should be more transparency and clarity to the description of how the individual modules and PDE modes are setup.

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 13 avr. 2010, 12:57 UTC−4
Hi Davis

I can only onfirm that your remarks concerning the "details behind" are also a lack I would like to fill in.
I have partly (but not on your subjects there) got inside information during discussions with COMSOL people at their courses, and at the Conferences (very usefull).

COMSOL is lacking a basic COMSOL mathematics course, even their advanced course(s) (which are good for the applications explained) is not giving you the basics behind. On one side I believe that COMSOL expect the academic community to make more courses about this, but there again, if the academics cannot get a minimum understanding of the "interiour", it is difficult for them to teach it further.

I have mostly found details in the references of the documentation and in general books on FEM, specially those having come out the last 10 years (my bookshelf on FEM was somewat older ;).

Concerning the book of Pryor, I can only there too confirm: you were unlucky, of the series of books about COMOSL I have, it is definitively the least interesting, it's a typical MS book, click here copy this ... no or hardly any Physics.

Have you had a look at Zimmermann's book ? I really like it, even if its about older versions.

Send a request to Comsol support and take it up with the COMSOL people on the next conference, it's worth it, they are quite reactive, especially when we find win-win situations

Ivar
Hi Davis I can only onfirm that your remarks concerning the "details behind" are also a lack I would like to fill in. I have partly (but not on your subjects there) got inside information during discussions with COMSOL people at their courses, and at the Conferences (very usefull). COMSOL is lacking a basic COMSOL mathematics course, even their advanced course(s) (which are good for the applications explained) is not giving you the basics behind. On one side I believe that COMSOL expect the academic community to make more courses about this, but there again, if the academics cannot get a minimum understanding of the "interiour", it is difficult for them to teach it further. I have mostly found details in the references of the documentation and in general books on FEM, specially those having come out the last 10 years (my bookshelf on FEM was somewat older ;). Concerning the book of Pryor, I can only there too confirm: you were unlucky, of the series of books about COMOSL I have, it is definitively the least interesting, it's a typical MS book, click here copy this ... no or hardly any Physics. Have you had a look at Zimmermann's book ? I really like it, even if its about older versions. Send a request to Comsol support and take it up with the COMSOL people on the next conference, it's worth it, they are quite reactive, especially when we find win-win situations Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 13 avr. 2010, 13:04 UTC−4
I agree that the connection between theoretical basis of FEM and how it is implemented in COMSOL should be explained a lot more clearly and perhaps concisely in the manuals. I would love to see a relatively high level summary document that very compactly shows this mostly using equations and not a lot of verbiage. In my experience the manuals are fairly complete (although some important details are missing) but they attempt to convey too much all at once and hard to use for some quick high level learning in a hurry - because you can't tell what is really important and what is detail without absorbing in the whole thing first. I hope to see a revamp of the manuals with an onion layer approach - though I realize this is easier said than done - to make it possible to use them effectively at varying level of details. I studied FEM and coded in FEM too in the past so I am highly familiar with the theory yet I still find it difficult to quickly figure out how COMSOL implementation is done and should be used, for example with regard to weak terms. I plan on spending some time writing out the equations, deriving different forms and seeing exactly what the manuals are trying to convey - a process I wish was made easier by a clearer explanation.

I saw a preview of this book by Pryor at the COMSOL conference and I was not impressed a bit for the reasons you outlined. The most useful COMSOL/FEM book in my opinion is the one by Zimmerman. It has a nicely balanced coverage of underlying theory and implementation in COMSOL.

I agree that the connection between theoretical basis of FEM and how it is implemented in COMSOL should be explained a lot more clearly and perhaps concisely in the manuals. I would love to see a relatively high level summary document that very compactly shows this mostly using equations and not a lot of verbiage. In my experience the manuals are fairly complete (although some important details are missing) but they attempt to convey too much all at once and hard to use for some quick high level learning in a hurry - because you can't tell what is really important and what is detail without absorbing in the whole thing first. I hope to see a revamp of the manuals with an onion layer approach - though I realize this is easier said than done - to make it possible to use them effectively at varying level of details. I studied FEM and coded in FEM too in the past so I am highly familiar with the theory yet I still find it difficult to quickly figure out how COMSOL implementation is done and should be used, for example with regard to weak terms. I plan on spending some time writing out the equations, deriving different forms and seeing exactly what the manuals are trying to convey - a process I wish was made easier by a clearer explanation. I saw a preview of this book by Pryor at the COMSOL conference and I was not impressed a bit for the reasons you outlined. The most useful COMSOL/FEM book in my opinion is the one by Zimmerman. It has a nicely balanced coverage of underlying theory and implementation in COMSOL.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 13 avr. 2010, 17:17 UTC−4

Hi Davis

I can only onfirm that your remarks concerning the "details behind" are also a lack I would like to fill in.
I have partly (but not on your subjects there) got inside information during discussions with COMSOL people at their courses, and at the Conferences (very usefull).

COMSOL is lacking a basic COMSOL mathematics course, even their advanced course(s) (which are good for the applications explained) is not giving you the basics behind. On one side I believe that COMSOL expect the academic community to make more courses about this, but there again, if the academics cannot get a minimum understanding of the "interiour", it is difficult for them to teach it further.

I have mostly found details in the references of the documentation and in general books on FEM, specially those having come out the last 10 years (my bookshelf on FEM was somewat older ;).

Concerning the book of Pryor, I can only there too confirm: you were unlucky, of the series of books about COMOSL I have, it is definitively the least interesting, it's a typical MS book, click here copy this ... no or hardly any Physics.

Have you had a look at Zimmermann's book ? I really like it, even if its about older versions.

Send a request to Comsol support and take it up with the COMSOL people on the next conference, it's worth it, they are quite reactive, especially when we find win-win situations

Ivar

Hi Ivar,

Thanks for the reply. Yes, I have Zimmermann's book, and it is infinitely better than Pryor's book. An additional complaint I have about Pryor is that, although it comes with a DVD with the models in the book already pre-built, many of them require modules that I don't have, and there is no warning about this. About Zimmermann's book, there are numerous typos, and he confuses streamlines and contours, and the Index is pretty sparse. Still, it's a good book, with a decent theory section, and has been quite helpful. However, it, too, doesn't have enough tutorial examples that concentrate on a single concept and explain it in depth, instead presenting rather complicated examples where there are too many things going on at once.

FWIW, we are lucky to have a Comsol rep making a presentation on campus later this month, so I'll have the chance to take up these matters with him then. I've already raised them in phone conversations, and he is sympathetic. (I'm also talking to him about GPU computing issues in regard to Comsol.)
[QUOTE] Hi Davis I can only onfirm that your remarks concerning the "details behind" are also a lack I would like to fill in. I have partly (but not on your subjects there) got inside information during discussions with COMSOL people at their courses, and at the Conferences (very usefull). COMSOL is lacking a basic COMSOL mathematics course, even their advanced course(s) (which are good for the applications explained) is not giving you the basics behind. On one side I believe that COMSOL expect the academic community to make more courses about this, but there again, if the academics cannot get a minimum understanding of the "interiour", it is difficult for them to teach it further. I have mostly found details in the references of the documentation and in general books on FEM, specially those having come out the last 10 years (my bookshelf on FEM was somewat older ;). Concerning the book of Pryor, I can only there too confirm: you were unlucky, of the series of books about COMOSL I have, it is definitively the least interesting, it's a typical MS book, click here copy this ... no or hardly any Physics. Have you had a look at Zimmermann's book ? I really like it, even if its about older versions. Send a request to Comsol support and take it up with the COMSOL people on the next conference, it's worth it, they are quite reactive, especially when we find win-win situations Ivar [/QUOTE] Hi Ivar, Thanks for the reply. Yes, I have Zimmermann's book, and it is infinitely better than Pryor's book. An additional complaint I have about Pryor is that, although it comes with a DVD with the models in the book already pre-built, many of them require modules that I don't have, and there is no warning about this. About Zimmermann's book, there are numerous typos, and he confuses streamlines and contours, and the Index is pretty sparse. Still, it's a good book, with a decent theory section, and has been quite helpful. However, it, too, doesn't have enough tutorial examples that concentrate on a single concept and explain it in depth, instead presenting rather complicated examples where there are too many things going on at once. FWIW, we are lucky to have a Comsol rep making a presentation on campus later this month, so I'll have the chance to take up these matters with him then. I've already raised them in phone conversations, and he is sympathetic. (I'm also talking to him about GPU computing issues in regard to Comsol.)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 13 avr. 2010, 17:56 UTC−4

I agree that the connection between theoretical basis of FEM and how it is implemented in COMSOL should be explained a lot more clearly and perhaps concisely in the manuals. I would love to see a relatively high level summary document that very compactly shows this mostly using equations and not a lot of verbiage. In my experience the manuals are fairly complete (although some important details are missing) but they attempt to convey too much all at once and hard to use for some quick high level learning in a hurry - because you can't tell what is really important and what is detail without absorbing in the whole thing first. I hope to see a revamp of the manuals with an onion layer approach - though I realize this is easier said than done - to make it possible to use them effectively at varying level of details. I studied FEM and coded in FEM too in the past so I am highly familiar with the theory yet I still find it difficult to quickly figure out how COMSOL implementation is done and should be used, for example with regard to weak terms. I plan on spending some time writing out the equations, deriving different forms and seeing exactly what the manuals are trying to convey - a process I wish was made easier by a clearer explanation.

I saw a preview of this book by Pryor at the COMSOL conference and I was not impressed a bit for the reasons you outlined. The most useful COMSOL/FEM book in my opinion is the one by Zimmerman. It has a nicely balanced coverage of underlying theory and implementation in COMSOL.


Ozgur, thanks for your comments. I agree about Zimmermann's book - see my comments to Ivar. I, too, spend a lot of time converting PDEs to weak form, then trying to figure out the relationship to the weak-term scripts as they are implemented in the models. The good news is that it forces one to really think about things, which is how one learns, I suppose. The bad news is that often I am not successful in figuring out the scripts.

What would be great is if the Comsol package came with a set of extremely simple examples that illustrate a single concept at a time, for example the various ways to solve a 1-D stationary PDE using different combinations of boundary conditions and interior points, the effect of including various weak and ultra-weak terms, etc. Another simple example could be devised to step systematically through each of the solvers to give users a chance to develop a feel for how they work and their limitations. Still another one to explore how the various shape functions work. In other words, strip the example of all inessential features that only serve to unnecessarily complicate and confuse. The emphasis should be on model simplicity, and there should be an accompanying tutorial manual that describes each of the simple examples with an emphasis on clarity of exposition.

I also agree with you about the need for a summary document that explains the mathematical details. I don't mind words if they clarify the mathematics, but they are no substitute for the mathematics itself. I would like to see detailed information about the various shape functions (which is where I'm spending my time puzzling over these days). Maybe something with a format and scope along the lines of what one might expect if there were a book titled "Comsol Multiphysics in a Nutshell" by O'Reilly.

Dave
[QUOTE] I agree that the connection between theoretical basis of FEM and how it is implemented in COMSOL should be explained a lot more clearly and perhaps concisely in the manuals. I would love to see a relatively high level summary document that very compactly shows this mostly using equations and not a lot of verbiage. In my experience the manuals are fairly complete (although some important details are missing) but they attempt to convey too much all at once and hard to use for some quick high level learning in a hurry - because you can't tell what is really important and what is detail without absorbing in the whole thing first. I hope to see a revamp of the manuals with an onion layer approach - though I realize this is easier said than done - to make it possible to use them effectively at varying level of details. I studied FEM and coded in FEM too in the past so I am highly familiar with the theory yet I still find it difficult to quickly figure out how COMSOL implementation is done and should be used, for example with regard to weak terms. I plan on spending some time writing out the equations, deriving different forms and seeing exactly what the manuals are trying to convey - a process I wish was made easier by a clearer explanation. I saw a preview of this book by Pryor at the COMSOL conference and I was not impressed a bit for the reasons you outlined. The most useful COMSOL/FEM book in my opinion is the one by Zimmerman. It has a nicely balanced coverage of underlying theory and implementation in COMSOL. [/QUOTE] Ozgur, thanks for your comments. I agree about Zimmermann's book - see my comments to Ivar. I, too, spend a lot of time converting PDEs to weak form, then trying to figure out the relationship to the weak-term scripts as they are implemented in the models. The good news is that it forces one to really think about things, which is how one learns, I suppose. The bad news is that often I am not successful in figuring out the scripts. What would be great is if the Comsol package came with a set of extremely simple examples that illustrate a single concept at a time, for example the various ways to solve a 1-D stationary PDE using different combinations of boundary conditions and interior points, the effect of including various weak and ultra-weak terms, etc. Another simple example could be devised to step systematically through each of the solvers to give users a chance to develop a feel for how they work and their limitations. Still another one to explore how the various shape functions work. In other words, strip the example of all inessential features that only serve to unnecessarily complicate and confuse. The emphasis should be on model simplicity, and there should be an accompanying tutorial manual that describes each of the simple examples with an emphasis on clarity of exposition. I also agree with you about the need for a summary document that explains the mathematical details. I don't mind words if they clarify the mathematics, but they are no substitute for the mathematics itself. I would like to see detailed information about the various shape functions (which is where I'm spending my time puzzling over these days). Maybe something with a format and scope along the lines of what one might expect if there were a book titled "Comsol Multiphysics in a Nutshell" by O'Reilly. Dave

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 14 avr. 2010, 01:31 UTC−4
Hi Dave & Ozgur

There are also the books of Lennart Edsberg, and the one of Pr. D.W. Pepper

(see www.comsol.com/academic/books/ )

that I can recommend, they describe the FEM theory in a notation close to the one of COMSOL, but there is not as such a direct link to COMSOL, so one need to take the (simple) examples there and run them through Comsol and study and compare the results, rather tedious but instructive (if you have time, what nobody finds today)

Have fun Comsoling
Ivar
Hi Dave & Ozgur There are also the books of Lennart Edsberg, and the one of Pr. D.W. Pepper (see http://www.comsol.com/academic/books/ ) that I can recommend, they describe the FEM theory in a notation close to the one of COMSOL, but there is not as such a direct link to COMSOL, so one need to take the (simple) examples there and run them through Comsol and study and compare the results, rather tedious but instructive (if you have time, what nobody finds today) Have fun Comsoling Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 14 avr. 2010, 01:49 UTC−4
Hi Guys , I have already expressed the very same frustration regaridng the lack of "depth and breadthe " of Comsol documentation...
they spent too much time on "showing off" their gui [ which is nice but today everybody knows how to find its way in a gui they are ubiquitous] and not enough time BY FAR on the inside working..
this frustrate me a big way because on the one hand they use the flexibility of theirr code as a marketing tool
[ and yes it is a GREAT piece of software no complaint here ] and then when you really want to use it you find that plenty of things are undocummentedwhile they are necessary to use the power they put in their tool int he first place.
I dont know what a typical comsol user is but I bought comsol for I could do things that were not possible with other fem codes which mean for me a LOT OF PDE modes and multiphysics coupling... so I feel these frustrations [almost] on a day to day basis.
I tried to getocassional help from Comsol [ we should not forgot that there is this support feature] on one very frustrating subject but could not even have the persons I communicated with understand my problem. [ OK it was a tough one I agree but still..]
and it boild down to One thing in my view there is a large gap between "state of the art"scientific computing as possible with comsol and comsol documentation. I believe COmsol should file this gap , not the academics, because they sell these features....
the examples above are good one as well as the one I submitted to comsol a few months ago as mentionned earlier on...
Sorry for the rant
have a great day
jf
Hi Guys , I have already expressed the very same frustration regaridng the lack of "depth and breadthe " of Comsol documentation... they spent too much time on "showing off" their gui [ which is nice but today everybody knows how to find its way in a gui they are ubiquitous] and not enough time BY FAR on the inside working.. this frustrate me a big way because on the one hand they use the flexibility of theirr code as a marketing tool [ and yes it is a GREAT piece of software no complaint here ] and then when you really want to use it you find that plenty of things are undocummentedwhile they are necessary to use the power they put in their tool int he first place. I dont know what a typical comsol user is but I bought comsol for I could do things that were not possible with other fem codes which mean for me a LOT OF PDE modes and multiphysics coupling... so I feel these frustrations [almost] on a day to day basis. I tried to getocassional help from Comsol [ we should not forgot that there is this support feature] on one very frustrating subject but could not even have the persons I communicated with understand my problem. [ OK it was a tough one I agree but still..] and it boild down to One thing in my view there is a large gap between "state of the art"scientific computing as possible with comsol and comsol documentation. I believe COmsol should file this gap , not the academics, because they sell these features.... the examples above are good one as well as the one I submitted to comsol a few months ago as mentionned earlier on... Sorry for the rant have a great day jf

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.