COMSOL Tips & Tricks - Tuning Your Solver Set-Up

Published: Tue, 02/18/14

Multiphysics analysis is one of the strengths of COMSOL.  And, they have put a lot of time and energy into tuning the default solver sequences to handle as many problems as possible as efficiently as possible.  However, it is important to be able to understand how to tune your solver set-up because the default settings don't always offer the optimum approach.    In all cases, COMSOL by default will solve all active equations simultaneously (using either a segregated or fully coupled solution approach).  But, did you know that if your equations are one-way coupled (aka sequentially coupled) that you can manually set-up COMSOL to solve in a step-wise fashion?  This can be a big memory saver and, if you are running a number of simulations, this can be a time saver as well.

 

One classic example of one-way coupled equations uses the heat transfer and solid mechanics equations when thermal expansion is involved.  A good assumption for this physical situation is that the temperature solution to the heat transfer equations affects the solid mechanics solution but not the reverse.  In other words, temperature affects expansion but expansion does not affect temperature.  In this case, the equations can be solved sequentially using a two step process.

 

The trick to implementing this 2 step process is knowing the correct way of passing the solution to the 1st step into the solver for the 2nd step.  Often COMSOL will "intelligently" set things up properly, but it's always a good idea to know how to check yourself that things are how you want them.  For this two step process, the following image shows the proper solver settings for Step 2.


With this set-up, we can be assured that the Temperature field solution from Step 1 will be used for the Solid Mechanics solution in Step 2.

 

However, if you are like us, you might get the itch to doubly confirm that everything is being read in properly.  To do this, first expand the default solver sequence and click on the Dependent Variables 2 node.  In the Settings window at the bottom under Output, change the Keep solution drop-down box to "Values of variables not solved for".  In this case, this setting refers to the temperature variable.  (Remember, we already solved for temperature in Step 1.)

Then, simply right-click on the Step 2 node and click "Get Initial Value for Step." as shown below: 

This will make the value of the temperature field that is being read in accessible from the Data Set for Solver 1.  You can now post-process to confirm that the desired temperature field is being read in properly.  Peace of mind is a good thing!


Stay tuned for more COMSOL Tips & Tricks next month. The more we dig in (daily), the more we want to share. Until then...


Jeff & Kyle

Principals



PS. Review our latest posts and learn about an upcoming contest: http://altasimtechnologies.com/blog/


Phone: 614-861-7015
www.AltaSimTechnologies.com