Creating Variables

Creating Variables

COMSOL Tips Featured Image
How crating variables in COMSOL Multiphysics

In this tip we will see how we can create variables in COMSOL Multiphysics. A variable is essentially defined by an expression of other variables, dependent variables, user input parameters, or entered values.

You can use variables for many important purposes, including the following:

  • To add a quantity for plotting and results evaluation.
  • To simplify the writing and readability of expressions.
  • To make evaluation of long expressions more efficient, especially if an expression occurs in several places.

All variables in the Physics Builder are tensors that are first declared and then defined. You typically do the declaration once in a central place.

In this tip we would to create a variable as follow:

u_meanU*t^2/sqrt(t^4-0.07[s^2]*t^2+0.0016[s^4])m/sInlet Mean Velocity


  1. In the Home toolbar, click Variables and choose Global Variables.
  2. In the Settings window for Variables, locate the Variables section.
  3. In the table, enter the information which you want. In this tip, they are the data which is given in the table above.

We can see the section in the COMSOL Multiphysics software interface.

CMS Website
Computational Modeling and Simulation is the simulation center of Acamech that models Mechanical Engineering Problems, especially Multiphysics Simulation; including Fluid Flow (CFD), Structural Mechanics, Acoustics, Heat Transfer as a unique Multiphysics problem. We use COMSOL Multiphysics, MATLAB, and Autodesk Inventor.

Leave a Reply

Your email address will not be published. Required fields are marked *