Manually Setting the Scaling of Variables

Solution Number: 1240
Title: Manually Setting the Scaling of Variables
Versions: All versions
Categories: Solver

Problem Description

Transient problems often begin with all fields at an initial value of zero. During the solution the fields may increase by a great deal, or only very slightly. The default behavior of the software is to assume a scaling for each field based upon physics and initial values, but these default scales may sometimes be quite far off, so you may need to manually change these scale factors.


For example, consider a problem involving the Electric Currents, Heat Transfer, and Solid Mechanics physics. The default initial value for Heat Transfer physics interface is 293.15K, and the software will automatically use this as the scale. The default initial values for Electric Currents and Solid Mechanics are that the electric potential and displacement fields are zero. When the initial values are zero the software will automatically use information from the physics interfaces to estimate a scaling. In the case of Solid Mechanics, for example, a scaling of 0.01 times the bounding box size of the geometry is used. Other physics interfaces will have different defaults. The scaling is shown at the beginning of the Log window, as in the screenshot below.
Default Scaling in the Solver Log

Solver log window showing the default scales that are automatically determined by the software.

Sometimes, these automatically determined scale factors are not reasonable, and you will need to manually set them. For example, you may know that the actual electric potential may get up to 10kV, the temperatures up to 500K, and but the displacements are expected to be quite small, on the order of 0.1mm.

To manually set scales, first generate the default solver sequence, if it does not already exist. Right-click on Study and select Show Default Solver, this will populate the the Study > Solver Configurations with the default solver settings. Go to the Dependent Variables node and expand it, you will see separate nodes for each field being solved for within the model. Select each node and, in the Settings for that node, switch the Scaling Method to Manual and enter the expected peak magnitude of that field over the whole simulation timespan, as shown in the screenshot below.

After completing the simulation, check the actual computed peak absolute values of all of the fields and compare them to these scale factors. If they differ by significantly more than an order of magnitude, consider re-running the simulation with updated scales.

Manual Scaling

Manual scaling of the electric potential, assuming a peak voltage of 10kV during the simulation


COMSOL makes every reasonable effort to verify the information you view on this page. Resources and documents are provided for your information only, and COMSOL makes no explicit or implied claims to their validity. COMSOL does not assume any legal liability for the accuracy of the data disclosed. Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark details.