COMSOL Multiphysics

This page contains info aimed at first time users of COMSOL on CRC, but may also be useful to more experienced users. 

Available Modules

COMSOL Multiphysics is a suite of simulation tools. Below is a list of specialized add-ons that the CRC is licensed to use:

Electromagnetics:

AC/DC, RF, and Semiconductor, 

Structural Mechanics & Acoustics:

Acoustic, MEMS, Structural Mechanics

Multipurpose Products

Particle Tracing,

Fluid Flow &
Heat Transfer Modules

CFD, Heat Transfer, Porous Media Flow,

Chemical Engineering
Modules

Battery Design, Chemical Reaction Engineering, Corrosion, Electrodeposition, Electrochemistry, Fuel Cell & Electrolyzer,

Interfacing Products

CAD Import Module, Design Module, Matlab/Simulink,

 

Access modalities for COMSOL

1- Using graphic user interface (VIZ)

 Please read the documentation on crc.pitt.edu/viz on how to access VIZ and then watch the video below:

 

2- Using command line interface

  • Login to the cluster
  • Copy a template job from /ihome/crc/how_to_run/comsol/bed_reactor to your own directory.
  • Submit the job by running  sbatch smp.slurm.
  • Adjust this job to correspond to your use case

 

Note 1: if you are using the same Slurm job submission script for your own simulation, all you have to do is to change the name of your input file and the number of nodes, cores, etc. 

Note 2: If you want to run a COMSOL simulation on the mpi cluster, look at this template: /ihome/crc/how_to_run/comsol/micromixer

Note 3: If you are using COMSOL for teaching purposes (for a course), you need to load the teaching module:

[shs159@login0 bed_reactor]$ module load comsol/5.6-teaching
[shs159@login0 bed_reactor]$ ml

Currently Loaded Modules:
  1) comsol/5.6-teaching

[shs159@login0 bed_reactor]$

 

Sample script

#!/bin/bash -l

#SBATCH --job-name=comsol_micromix
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=4
#SBATCH --time=0-01:00:00       # Syntax is DD-HH:MM:SS
#SBATCH --cluster=smp           # Run crc-sinfo.py to get the cluster and partition details
#SBATCH --partition=smp

# Load Modules
module load comsol/5.6

# define input
inp=packed_bed_reactor_3d  # First input argument: Name of input without extention
ext=mph # We use the same naming scheme as the software default extention

##########################
#DO NOT TOUCH THE FOLLOWING
##########################
# define directories
submitdir=${SLURM_SUBMIT_DIR}

# run Comsol
comsol batch -nn ${SLURM_NNODES}\
             -np ${SLURM_NTASKS_PER_NODE}\
             -inputfile ${inp}.${ext}\
             -outputfile ${inp}_out.${ext}\
             -batch \
             -mlroot /ihome/crc/install/matlab/R2021a/\
             -batchlog logfile.log

 

You may now have submitted your first COMSOL job.

Good luck with your (MULTI)physics!

 

Checking the License Status

The CRC is licensed to use COMSOL, but the number of licenses is not particularly high for certain tools.

The licenses also operate on a per node basis, meaning two jobs by the same user submitted to different compute nodes will use up a license until those jobs are completed. Please be considerate of other users when submitting long jobs. Also, if you use VIZ to access COMSOL with a GUI, please make sure your session is ended properly when you are done so that others may use it. 

 

When you load the COMSOL module, truncated version of the license output will appear.

[nlc60@login0b ~]#module load comsol

CURRENT LICENSE AVAILABILITY OF COMSOL GUI:
Users of COMSOLGUI:  (Total of 5 licenses issued;  Total of 2 licenses in use)
  "COMSOLGUI" v6.0, vendor: LMCOMSOL, expiry: 1-oct-2022
[nlc60@login0b comsol] : module list

Currently Loaded Modules:
  1) comsol/5.6

This shows the availability of COMSOL GUI for users attempting to open COMSOL on VIZ.

You may see an error like this if all of the GUI licenses are in use:

 

For the full license information output, use the command:

[kimwong@login1.crc.pitt.edu ~]$module load comsol/check_license
CURRENT LICENSE AVAILIBILITY FOR COMSOL:
lmutil - Copyright (c) 1989-2021 Flexera. All Rights Reserved.
Flexible License Manager status on Thu 2/10/2022 17:21

License server status: 4800@ssoe-vlic-07.engr.pitt.edu
    License file(s) on ssoe-vlic-07.engr.pitt.edu: C:\Program Files\COMSOL\COMSOL60\Multiphysics\license\license.dat:

ssoe-vlic-07.engr.pitt.edu: license server UP (MASTER) v11.18.1

Vendor daemon status (on ssoe-vlic-07.engr.pitt.edu):

  LMCOMSOL: UP v11.18.1
Feature usage info:

Users of PERMANENT:  (Uncounted, node-locked)

Users of SERIAL:  (Uncounted, node-locked)

  "SERIAL" v6.0, vendor: LMCOMSOL, expiry: 1-oct-2022
  vendor_string: Y,57F1198202190D83
  uncounted nodelocked license locked to NOTHING (hostid=ANY)

    bam184 viz-n1.crc.pitt.edu /dev/pts/22 (v5.6) (ssoe-vlic-07.engr.pitt.edu/4800 1408), start Mon 2/7 11:59
    jre31 smp-n162.crc.pitt.edu /dev/tty (v5.6) (ssoe-vlic-07.engr.pitt.edu/4800 688), start Thu 2/10 15:05

Users of ACDC:  (Total of 5 licenses issued;  Total of 0 licenses in use)

Users of ACDCBATCH:  (Total of 5 licenses issued;  Total of 0 licenses in use)

Users of ACOUSTICS:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of ACOUSTICSBATCH:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of BATTERYDESIGN:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of BATTERYDESIGNBATCH:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of CADIMPORT:  (Total of 4 licenses issued;  Total of 0 licenses in use)

Users of CADIMPORTBATCH:  (Total of 4 licenses issued;  Total of 0 licenses in use)

Users of CFD:  (Total of 3 licenses issued;  Total of 0 licenses in use)

Users of CFDBATCH:  (Total of 3 licenses issued;  Total of 0 licenses in use)

Users of CHEM:  (Total of 3 licenses issued;  Total of 0 licenses in use)

Users of CHEMBATCH:  (Total of 3 licenses issued;  Total of 0 licenses in use)

Users of COMSOL:  (Total of 5 licenses issued;  Total of 2 licenses in use)

  "COMSOL" v6.0, vendor: LMCOMSOL, expiry: 1-oct-2022
  floating license

    bam184 viz-n1.crc.pitt.edu /dev/pts/22 (v5.6) (ssoe-vlic-07.engr.pitt.edu/4800 943), start Mon 2/7 11:59
    jre31 smp-n162.crc.pitt.edu /dev/tty (v5.6) (ssoe-vlic-07.engr.pitt.edu/4800 353), start Thu 2/10 15:05

Users of COMSOLBATCH:  (Total of 5 licenses issued;  Total of 0 licenses in use)

Users of CORROSION:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of CORROSIONBATCH:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of DESIGN:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of DESIGNBATCH:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of ELECTROCHEMISTRY:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of ELECTROCHEMISTRYBATCH:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of ELECTRODEPOSITION:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of ELECTRODEPOSITIONBATCH:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of FUELCELLANDELECTROLYZER:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of FUELCELLANDELECTROLYZERBATCH:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of HEATTRANSFER:  (Total of 3 licenses issued;  Total of 0 licenses in use)

Users of HEATTRANSFERBATCH:  (Total of 3 licenses issued;  Total of 0 licenses in use)

Users of LLMATLAB:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of LLMATLABBATCH:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of MEMS:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of MEMSBATCH:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of PARTICLETRACING:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of PARTICLETRACINGBATCH:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of POROUSMEDIAFLOW:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of POROUSMEDIAFLOWBATCH:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of RF:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of RFBATCH:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of SEMICONDUCTOR:  (Total of 2 licenses issued;  Total of 2 licenses in use)

  "SEMICONDUCTOR" v6.0, vendor: LMCOMSOL, expiry: 1-oct-2022
  floating license

    bam184 viz-n1.crc.pitt.edu /dev/pts/22 (v5.6) (ssoe-vlic-07.engr.pitt.edu/4800 1515), start Wed 2/9 10:18
    jre31 smp-n162.crc.pitt.edu /dev/tty (v5.6) (ssoe-vlic-07.engr.pitt.edu/4800 2321), start Thu 2/10 15:05

Users of SEMICONDUCTORBATCH:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of STRUCTURALMECHANICS:  (Total of 3 licenses issued;  Total of 0 licenses in use)

Users of STRUCTURALMECHANICSBATCH:  (Total of 3 licenses issued;  Total of 0 licenses in use)

Users of COMSOLGUI:  (Total of 5 licenses issued;  Total of 1 license in use)

  "COMSOLGUI" v6.0, vendor: LMCOMSOL, expiry: 1-oct-2022
  floating license

    bam184 viz-n1.crc.pitt.edu /dev/pts/22 (v5.6) (ssoe-vlic-07.engr.pitt.edu/4800 213), start Mon 2/7 11:59

Users of CLIENTSERVER:  (Total of 5 licenses issued;  Total of 0 licenses in use)

Users of CLUSTERNODE:  (Total of 5 licenses issued;  Total of 1 license in use)

  "CLUSTERNODE" v6.0, vendor: LMCOMSOL, expiry: 1-oct-2022
  floating license

    jre31 smp-n162.crc.pitt.edu /dev/tty (v5.6) (ssoe-vlic-07.engr.pitt.edu/4800 1228), start Thu 2/10 15:05

Users of COMSOLUSER:  (Total of 5 licenses issued;  Total of 2 licenses in use)

  "COMSOLUSER" v6.0, vendor: LMCOMSOL, expiry: 1-oct-2022
  floating license

    bam184 viz-n1.crc.pitt.edu /dev/pts/22 (v5.6) (ssoe-vlic-07.engr.pitt.edu/4800 115), start Mon 2/7 11:59
    jre31 smp-n162.crc.pitt.edu /dev/tty (v5.6) (ssoe-vlic-07.engr.pitt.edu/4800 1334), start Thu 2/10 15:05

Users of MODELMANAGER:  (Total of 5 licenses issued;  Total of 0 licenses in use)

Users of MODELMANAGERBATCH:  (Total of 5 licenses issued;  Total of 0 licenses in use)

Users of MODELMANAGERSERVER:  (Total of 5 licenses issued;  Total of 0 licenses in use)

Users of MODELMANAGERSERVERBATCH:  (Total of 5 licenses issued;  Total of 0 licenses in use)

Users of CADREADER:  (Total of 4 licenses issued;  Total of 0 licenses in use)

Users of CADREADERBATCH:  (Total of 4 licenses issued;  Total of 0 licenses in use)

Users of CADIMPORTUSER:  (Total of 4 licenses issued;  Total of 0 licenses in use)

Users of BATTERIESANDFUELCELLS:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of BATTERIESANDFUELCELLSBATCH:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of ACO:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of HT:  (Total of 3 licenses issued;  Total of 0 licenses in use)

Users of SME:  (Total of 3 licenses issued;  Total of 0 licenses in use)

If you know the name of the functionality you want to use, you can pipe the output to grep for a more concise output.

If the particular tool you want to use does not have available licenses for you to use, you will need to wait until another user's jobs finish. 

 

With a username from the license file, you can check the remaining time on their jobs with squeue. For example, let's look at the user jre31 from the license server output above:

​ jre31 smp-n162.crc.pitt.edu /dev/tty (v5.6) (ssoe-vlic-07.engr.pitt.edu/4800 1334), start Thu 2/10 15:05

Their username is jre31, and their job is running on a compute node in the smp cluster (smp-n162). 

squeue -M smp -u jre31 -o "%.18i %.9P %.8j %.8u %.2t %.10M %.6D %.20R %L" 

will show their jobs on that cluster, and providing the %L argument to the format of the output of that function shows the TIME_LEFT (D-HH:MM:SS) given how long the job has been running and the QOS they defined for the job.