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.
Best practice for conditionaly switched boundary condition (simulations with multiple steps)
Posted 22 nov 2011, 06:03 GMT-5 Modeling Tools & Definitions, Parameters, Variables, & Functions, Studies & Solvers Version 4.2 6 Replies
Please login with a confirmed email address before reporting spam
Hello!
I am trying to model the coupled heat and mass transfer of a refrigeration cycle. The model includes distinct steps with different boundary conditions. Switching times cannot be fixed but depend on physical quantities (e.g. pressure at a certain point). Now, I am wondering what is the best practice to implement these conditional switches in the boundary conditions. I tryed different approaches documented in the forum, knowledge base or conference paper that all have drawbacks. I feel like this topic has not been fully discussed, especially for version 4.2 (see www.comsol.com/community/forums/general/thread/6746/).
The simplest approach would be hard switching (BC1*(p<p1) + BC2*(p>=p1)). This leads to long solving times due to unsteadiness of the BC or (in my case) to infinity switching back and forth (negative feedback between BC and switch condition).
This approach can be further refined with a) smoothed step functions (www.comsol.com/support/knowledgebase/905/) or b) a complicated procedure that uses a sub domain to get "one-way-only" step by integrating a positive pulse of a switch variable defined by a differential equation (www.comsol.com/conference2011/usa/abstract/id/10337/lam_abstract.pdf).
Nevertheless, even with all these laborious refinements a well converging model needs manual adjustment (smoothening etc.) when ever parameters of the model are changed. This disqualifies the approach for parametric sweep, hence this is exactly what I want to use the model for. Furthermore, solving times are long, as the solver wants to calculate the moment of switching with all precision, though these moments are not interesting for me. (Simply spoken: the approach seems improvised, a bit von-hinten-durch-die-Brust-ins-Auge)
A second approach, that has sparsely been mentioned in some threats in this forum (first link above): a "save solution" in between the steps and a (automatic?) restart (of a second solver?) with the new BC and the solutions from the end of the step before as new initial values. I still have not found how to implement this in 4.2 (neither by searching here nor by trying on my own). This seems promising and more straight forward. However, I am not sure if post-processing becomes a issue (haven't yet been able to try;).
A third approach includes a matlab frame, calling the model with different BC for each step. The problem: no matlab available. (I remember some one writing that matlab is not necessary anymore with Comsol 4 ...)
Is there a way to implement approach 2 in 4.2, or are there even better solutions to this, I guess, not unusual problem?
Thank you!
I am trying to model the coupled heat and mass transfer of a refrigeration cycle. The model includes distinct steps with different boundary conditions. Switching times cannot be fixed but depend on physical quantities (e.g. pressure at a certain point). Now, I am wondering what is the best practice to implement these conditional switches in the boundary conditions. I tryed different approaches documented in the forum, knowledge base or conference paper that all have drawbacks. I feel like this topic has not been fully discussed, especially for version 4.2 (see www.comsol.com/community/forums/general/thread/6746/).
The simplest approach would be hard switching (BC1*(p<p1) + BC2*(p>=p1)). This leads to long solving times due to unsteadiness of the BC or (in my case) to infinity switching back and forth (negative feedback between BC and switch condition).
This approach can be further refined with a) smoothed step functions (www.comsol.com/support/knowledgebase/905/) or b) a complicated procedure that uses a sub domain to get "one-way-only" step by integrating a positive pulse of a switch variable defined by a differential equation (www.comsol.com/conference2011/usa/abstract/id/10337/lam_abstract.pdf).
Nevertheless, even with all these laborious refinements a well converging model needs manual adjustment (smoothening etc.) when ever parameters of the model are changed. This disqualifies the approach for parametric sweep, hence this is exactly what I want to use the model for. Furthermore, solving times are long, as the solver wants to calculate the moment of switching with all precision, though these moments are not interesting for me. (Simply spoken: the approach seems improvised, a bit von-hinten-durch-die-Brust-ins-Auge)
A second approach, that has sparsely been mentioned in some threats in this forum (first link above): a "save solution" in between the steps and a (automatic?) restart (of a second solver?) with the new BC and the solutions from the end of the step before as new initial values. I still have not found how to implement this in 4.2 (neither by searching here nor by trying on my own). This seems promising and more straight forward. However, I am not sure if post-processing becomes a issue (haven't yet been able to try;).
A third approach includes a matlab frame, calling the model with different BC for each step. The problem: no matlab available. (I remember some one writing that matlab is not necessary anymore with Comsol 4 ...)
Is there a way to implement approach 2 in 4.2, or are there even better solutions to this, I guess, not unusual problem?
Thank you!
6 Replies Last Post 15 set 2012, 05:21 GMT-4