Edgar J. Kaiser
Certified Consultant
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
2017年12月23日 GMT+1 00:34
Maciej,
there may be different ways to achieve that, depending on what the parameter is actually doing. If it controls a boundary condition, you may try the following: - Duplicate the respective BC node - Use the start parameter in the first node - Use the calculated variable in the second node - Set up two successive stationary steps - Modify the physics tree: disable the second BC version in the first study and the first BC version in the second study.
This should work for any kind of physics subnode, not only BCs. If the parameter is doing something that affects geometry or mesh, things get more difficult.
Cheers Edgar
-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Maciej, there may be different ways to achieve that, depending on what the parameter is actually doing. If it controls a boundary condition, you may try the following: - Duplicate the respective BC node - Use the start parameter in the first node - Use the calculated variable in the second node - Set up two successive stationary steps - Modify the physics tree: disable the second BC version in the first study and the first BC version in the second study. This should work for any kind of physics subnode, not only BCs. If the parameter is doing something that affects geometry or mesh, things get more difficult. Cheers Edgar
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
2017年12月23日 GMT+1 12:47
Dear Edgar, thank you for your reply!
One thing I don't understand - "Use the calculated variable in the second node" - how can I refer to an integral calculated in the previous study? If I would just replace parameter "p0" with "p0/intop1(w)" in the second BC, the integral would keep being evaluated and updated during the calculation of the second study. I would like to save its value from the first study and use that in the second one.
Best regards Maciej
Dear Edgar, thank you for your reply! One thing I don't understand - "Use the calculated variable in the second node" - how can I refer to an integral calculated in the previous study? If I would just replace parameter "p0" with "p0/intop1(w)" in the second BC, the integral would keep being evaluated and updated during the calculation of the second study. I would like to save its value from the first study and use that in the second one. Best regards Maciej
Edgar J. Kaiser
Certified Consultant
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
2017年12月23日 GMT+1 14:57
Hi Maciej,
you are right, it doesn't work this way. Actually, my suggestion didn't come out of the blue, but my case was indeed different. One other way, that comes to my mind is to duplicate the whole physics node and add a global equation to the first physics. Check here: https://www.comsol.de/blogs/using-the-previous-solution-operator-in-transient-modeling/ to see an example how to take advantage of global equations. It is again different from what you need, but it may trigger an idea.
Good luck Edgar
-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi Maciej, you are right, it doesn't work this way. Actually, my suggestion didn't come out of the blue, but my case was indeed different. One other way, that comes to my mind is to duplicate the whole physics node and add a global equation to the first physics. Check here: https://www.comsol.de/blogs/using-the-previous-solution-operator-in-transient-modeling/ to see an example how to take advantage of global equations. It is again different from what you need, but it may trigger an idea. Good luck Edgar
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
2017年12月23日 GMT+1 17:22
Dear Edgar,
Thank you for your suggestion, I used global equations instead and they work great!
Best regards
Maciej
Dear Edgar, Thank you for your suggestion, I used global equations instead and they work great! Best regards Maciej
Henrik Sönnerlind
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
2017年12月23日 GMT+1 20:22
Hi,
Edgar's first suggestion should work if you wrap 'w' in the withsol() operator so that you can explicitly point to the intended solution.
Regards,
Henrik
-------------------
Henrik Sönnerlind
COMSOL
Hi, Edgar's first suggestion should work if you wrap 'w' in the withsol() operator so that you can explicitly point to the intended solution. Regards, Henrik
Edgar J. Kaiser
Certified Consultant
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
2017年12月23日 GMT+1 23:37
Hi Henrik,
interesting! But is withsol() useable in the solver sequence in such a case? So far I assumed (and experienced) that it only works reliably in post processing? Well, it seems to work during solving in specific cases which are not documented as far as I know.
Cheers Edgar
-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi Henrik, interesting! But is withsol() useable in the solver sequence in such a case? So far I assumed (and experienced) that it only works reliably in post processing? Well, it seems to work during solving in specific cases which are not documented as far as I know. Cheers Edgar
Henrik Sönnerlind
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
2017年12月25日 GMT+1 15:41
Hi Edgar,
You are probably thinking of the 'with()' operator, which is only available in postprocessing.
The 'withsol()' operator (which was added in version 5.1) can be used anywhere; in expressions, variables, etc. The only restriction is that the solution you are pointing to must have been computed when the expression is evaluated.
Some examples from previous forum discussions:
https://www.comsol.com/forum/thread/90501/is-it-possible-toselect-a-particular-solution-of-a-certain-data-set-using-withsol
https://www.comsol.com/forum/thread/101611/previous-solution-as-constant
https://www.comsol.com/forum/thread/86181/reusing-solution-displacements-should-be-easy-help-please
Regards,
Henrik
-------------------
Henrik Sönnerlind
COMSOL
Hi Edgar, You are probably thinking of the 'with()' operator, which is only available in postprocessing. The 'withsol()' operator (which was added in version 5.1) can be used anywhere; in expressions, variables, etc. The only restriction is that the solution you are pointing to must have been computed when the expression is evaluated. Some examples from previous forum discussions: https://www.comsol.com/forum/thread/90501/is-it-possible-toselect-a-particular-solution-of-a-certain-data-set-using-withsol https://www.comsol.com/forum/thread/101611/previous-solution-as-constant https://www.comsol.com/forum/thread/86181/reusing-solution-displacements-should-be-easy-help-please Regards, Henrik
Edgar J. Kaiser
Certified Consultant
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
2017年12月25日 GMT+1 17:03
Henrik,
yes in this case the solution is finished and it is possible to point to it with withsol(). I failed with withsol() in cases when I would have had to reference a parametric solution while the auxiliary sweep is still running.
Cheers Edgar
-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Henrik, yes in this case the solution is finished and it is possible to point to it with withsol(). I failed with withsol() in cases when I would have had to reference a parametric solution while the auxiliary sweep is still running. Cheers Edgar