COMSOL

Description

From the COMSOL Website: 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. Additional interfacing products connect your COMSOL Multiphysics simulations with technical computing, CAD, and ECAD software.

Version

  • 6.0

Authorized Users

  • CIRCE account holders
  • RRA account holders
  • SC account holders

Platforms

  • CIRCE cluster
  • Workstation/PC, Cluster

Modules

COMSOL requires the following module file to run:

  • apps/comsol/6.0

Available COMSOL Modules

  • AC/DC Module
  • CFD Module
  • Chemical Reaction Engineering Module
  • Heat Transfer Module
  • MEMS Module
  • Microfluidics Module
  • Nonlinear Structural Materials Module
  • Particle Tracing Module
  • RF Module
  • Structural Mechanics Module
  • Subsurface Flow Module
  • CAD Import Module
  • ECAD Import Module
  • LiveLink for MATLAB

Installation

Please note: in order to install/use COMSOL, you must do one of the following:

  • Use COMSOL from a machine on-campus (ex: a desktop/laptop connected via wired/wifi)
  • Use the USF VPN (https://vpn.usf.edu) to connect from off-campus first, then start COMSOL


Installing COMSOL On Windows 8/8.1/10 and OSX

  1. Download the appropriate .iso installer file from https://mirror.rc.usf.edu/isos/Comsol/
  2. Mount the .iso file
    • On Windows: right-click on the .iso file, and click Mount
    • On OSX: Double-click on the .iso file
  3. Double-click the setup.exe file to start the installer
  4. Select the language for the installer, and click Next
  5. Click the New COMSOL Installation button
  6. If you accept the license agreement, click the I accept the terms of the license agreement and understand and acknowledge that with this acceptance all other terms are rejected button, then enter the information as shown below, then click Next:
    • select <port number>@<hostname> from the License format: drop down
    • port number: 27000
    • hostname: license0.rc.usf.edu
    • name: Your USF NetID (all lower-case)
    • company: University of South Florida
  7. Select the appropriate products and libraries that you require, and click Next
  8. Select the appropriate desktop shortcut and update options, and click Next
  9. If using LiveLink for Matlab, enter the path to your local install of Matlab, and click Next.
    • If not using LiveLink, leave blank and click Next
  10. Click the Install button to start the installation
  11. Once completed, click the Close button to finish the installation
  12. Un-mount the .iso file
    • On Windows: Open File Explorer, right-click on the appropriate DVD drive (most likely either D: or E:), and click Eject
    • On OSX: Drag the "Comsol" disk icon on your desktop to the Eject button on the task bar

Running COMSOL Jobs on CIRCE

Tasks Shorter than 30 Minutes

Before you login to CIRCE, you need to make sure you have X11 Forwarding enabled. If you're logging in from a UNIX/Linux system, you will need to do the following:

[user@login0 ~]$ ssh -Y user@circe.rc.usf.edu

Once connected to CIRCE, you can open COMSOL using the steps below:

[user@login0 ~]$ module add apps/comsol/6.0
[user@login0 ~]$ comsol

Alternatively, for Windows, Mac, and Linux users, COMSOL can also be launched through a remote desktop connection, then opening a terminal, loading the appropriate module file, and typing comsol. For more information about the CIRCE Desktop Environment, please see our CIRCE Desktop Environment documentation.

Tasks Longer than 30 Minutes

For computational tasks that will run longer than 30 minutes, you will need to start an interactive SRUN session by running the command below with example resources:

[user@login0 ~]$ srun --time=02:00:00 --nodes=1 --cpus-per-task=8 --pty /bin/bash

This will request an interactive session on a compute node, with 8 processor cores, for a duration of 2 hours.

COMSOL Batch Jobs from the Command Line

The COMSOL user guide is essential to understanding the application and making the most of it. The guide and this page should help you to get started with your simulations. Please refer to the Documentation section for a link to the guide.

  • Note on CIRCE: Make sure to run your jobs from your $WORK directory!
  • Note: Scripts are provided as examples only. Your SLURM executables, tools, and options may vary from the example below. For help on submitting jobs to the queue, see our SLURM User’s Guide.

Running Comsol on CIRCE is quite trivial. When you are ready to run the solver against your model, save the model and copy the ‘.mph’ file to CIRCE via which ever method you prefer and run:

sbatch --job-name=mymodel.mph runcomsol.sh

You will need to add the following information in a script file and reference it in the sbatch command argument:

#!/bin/bash
#
#SBATCH --time=04:00:00
#SBATCH --mem-per-cpu=2048
#SBATCH --ntasks=8

#### SLURM 8 processor COMSOL test to run for 4 hours.

module purge
module add apps/comsol/6.0

# Change the below path to an actual temporary directory!
# To create one on the fly on local node storage, use:
# export TMPDIR=$(mktemp -d)
export TMPDIR="/path/to/temp/dir"

comsol -clustersimple batch -inputfile ${SLURM_JOB_NAME} \
       -outputfile ${SLURM_JOB_NAME//\.mph/}.out.mph \
       -batchlog ${SLURM_JOB_NAME}.${SLURM_JOB_ID}.comsol_log \
       -tmpdir $TMPDIR


For non-distributed, SMP jobs, the following script will work:

#!/bin/bash
#
#SBATCH --time=24:00:00
#SBATCH --mem=16384
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=12

#### SLURM 12 processor COMSOL test to run for 24 hours.

module purge
module add apps/comsol/6.0

# Change the below path to an actual temporary directory!
# To create one on the fly on local node storage, use:
# export TMPDIR=$(mktemp -d)
export TMPDIR="/path/to/temp/dir"

comsol batch -np ${SLURM_NTASKS} -inputfile ${SLURM_JOB_NAME} \
        -outputfile ${SLURM_JOB_NAME}.${SLURM_JOB_ID} \
        -batchlog ${SLURM_JOB_NAME}.${SLURM_JOB_ID}.comsol_log \
        -tmpdir $TMPDIR


Solution data will be stored within the ‘.mph’ file and can be viewed on your local machine simply by copying the file back once you are done. A preferred way to deal with this is to use your home directory share to map your CIRCE home directory as a network drive. Then, you can simply save the file to the network drive, move it to your /work directory, and run the simulation on CIRCE. When the simulation is complete, copy the file back to your home on CIRCE, and re-open the file to review the results on your desktop.

Documentation

Home Page, User Guides, and Manuals

Benchmarks, Known Tests, Examples, Tutorials, and Other Resources

More Job Information

See the following for more detailed job submission information:

Reporting Bugs

Report bugs with COMSOL to the IT Help Desk: rc-help@usf.edu