Software name: 

Comsol is available to users with their own license server.


COMSOL Multiphysics is a general-purpose software platform, based on advanced numerical methods, for modeling and simulating physics-based problems.


COMSOL Multiphysics is a general-purpose software platform, based on advanced numerical methods, for modeling and simulating physics-based problems. With COMSOL Multiphysics, you will be able to account for coupled or multiphysics phenomena. With more than 30 add-on products to choose from, you can further expand the simulation platform with dedicated physics interfaces and tools for electrical, mechanical, fluid flow, and chemical applications.


Comsol is available on Kebnekaise


To use Comsol you need to have a license server running at your home institute. The license server must be reachable from HPC2N, i.e., any firewalls must be opened for access from HPC2N networks.

Usage at HPC2N 

Comsol is available as a module. To see which versions are available use:

module spider comsol

Read the page about modules for the system to see how to load the required module.

Running Comsol

To run Comsol through the batch system your submit file must first load the correct module and then include a line that points it to your license server.

export LMCOMSOL_LICENSE_FILE=port@hostname.of.your.license.server

For information on the correct port and hostname, consult you local Comsol license administrator.

You should then run comsol with the "batch" argument. See Comsols documentation for details.

A small example is:

#SBATCH -A <your-project>
#SBATCH -n 4
#SBATCH -t 00:10:00
module add COMSOL/
comsol batch -inputfile  journalbearingDemo.mph -outputfile output.mph -batchlog batchlog.txt


To use the Comsol GUI you must be logged in through the thinlinc system, see for details.

Open a terminal window, set LMCOMSOL_LICENSE_FILE to point to your license server as shown above, and load the correct Comsol module. Then run "comsol".

Before running the computation there are a few things you need to setup. If you have previously tried using the Comsol GUI we strongly advise you to first remove all previous settings that comsol saves. When the settings has been created as per below, do not remove the settings again.

# Do this if you need to remove the settings
rm -rf $HOME/.comsol

Basic batch system settings

The changes here are global in nature and will be the same next time comsol is started.

  1. Go to "Options" -> "Preferences":
    1. Under "Multicore and Cluster Computing":
      1. Make sure "Scheduler type" is set to "SLURM".
      2. In "Additional scheduler arguments" add "-A your-snic-project-id" (without the quotation marks).
      3. Make sure "Scheduler" is set to "localhost".
      4. Add "-c port@hostname.of.your.license.server" to "Postpend command", using the same port and hostname that is used for LMCOMSOL_LICENSE_FILE above.
    2. Under "Show more options":
      1. Under "Study", mark the "Batch and Cluster" box.
    3. Click the "Ok" button.

Case setup

  1. Go to "Options" -> "Preferences":
    1. Under "Multicore and Cluster Computing":
      1. Check that "Batch directory" is set to your working directory.
      2. Mark the "Number of cores" box and set the number of to the number of threads you want to use. This is the number of threads Comsol will use per MPI task.
        This step requires a restart of comsol later.
      3. Add "-c x" to "Additional scheduler arguments" replacing "x" with the value selected at the previous step. (This is not required if the value is 1).
        If "-c x" is not set to the same value as in step 2, the cores will be over allocated and the performance will suffer.
      4. Click the "Ok" button, and restart comsol.
  2. Right-click "Study 1" and select "Cluster Computing":
    1. Check that "Settings" is set to "Preferences controlled".
  3. Right-click "Study 1" and select "Show Default Solver":
    1. Under the new "Job Configurations" select "Cluster Computing 1":
      1. Select the number of MPI tasks per host you want to use at "Number of processes on host".
        If you only want to use threaded computations, leave it at 1.
      2. Unset the "Exclusive nodes" box.
      3. Change "Runtime" to the amount of time your computations is expected to take, make sure to NOT leave it as "Infinite".
  4. Select "Study 1" and run the computation.
Updated: 2024-05-14, 14:17