学习中心

手动设置变量的缩放比例


COMSOL® 软件会自动为模型中的每组变量假设不同的缩放比例。这些比例因子默认由软件自动确定,但有时也需要进行手动调整,本文将讨论它们对模型的重要性以及如何进行手动设置。

A screenshot of the Settings window for the Dependent Variables node, with the General, Initial Values of Variables Solved For, Scaling, and Residual Scaling sections expanded.

因变量 节点的 设置 窗口。

变量比例的重要意义

为了完成数值计算,通常需要设置比例。在求解几个不同的场时,一些场的平均量级可能与其他场有很大差异,同时求解这两个场可能会导致数值问题。比例因子就是用来避免这种情况的。

例如,考虑一个涉及电流、传热和固体力学物理场的瞬态问题。固体传热 物理场接口的默认初始值为 293.15 K,软件将自动以此为比例。而 电流固体力学 物理场接口的电势场和位移场的默认初始值分别设置为零。

A screenshot of the Initial Values node Settings window when modeling electrical physics in COMSOL Multiphysics. A screenshot of the Initial Values node Settings window when modeling electrical physics in COMSOL Multiphysics.
The Settings window for the Initial Values node, with the Domain Selection and Initial Values sections expanded and set for a structural modeling problem. The Settings window for the Initial Values node, with the Domain Selection and Initial Values sections expanded and set for a structural modeling problem.
The Settings window for the Initial Values node, with the Domain Selection and Initial Values sections expanded and set for a structural modeling problem. The Settings window for the Initial Values node, with the Domain Selection and Initial Values sections expanded and set for a structural modeling problem.

电流(左)、固体传热(中)和固体力学(右)物理场 初始值 节点的默认设置。

当初始值为零时,软件将自动使用物理场接口的信息来估算比例。以 固体力学 接口为例,使用的比例为几何体大小的 0.01 倍。其他物理场接口也会有各自不同的默认值。这些比例将在求解器 日志 窗口的开头显示,如下图所示。

A screenshot of the solver log window in COMSOL Multiphysics with the default scales highlighted with red boxes.

求解器日志窗口,显示了软件自动确定的默认比例。

有时,这些自动确定的比例因子并不合理,需要手动设置。

手动设置比例

例如, 您可能已知实际电势可高达 10 kV,温度可高达 500 K,但位移预计会非常小,大约为 0.01 mm。

为了手动设置比例,首先要生成默认求解器序列(如果未预先生成的话)。右键单击 研究 节点并选择 显示默认求解器 ,这将在 研究 > 求解器配置 节点中填充默认求解器设置。然后转到 因变量 节点并展开,现在,您将看到模型中每个待求解物理场的独立节点。

选中每个节点,然后在 设置 窗口中将 缩放方法 切换为 手动,输入该场在整个模拟时间段内的预期峰值大小,如下图所示,

A screenshot of the settings for the electric potential in a model with the Scaling section open and the Scale manually set to 10000.

手动缩放电势,假设模拟期间的峰值电压为 10 kV。

A screenshot of the settings for the temperature in a model, with the Scaling section open and the Scale manually set to 500.

手动调节温度,假设模拟期间的峰值温度为 500 K。

A screenshot of the settings for the displacement field in a model, with the Scaling section opened and the Scale manually set to 1e-5.

手动缩放位移,假设位移非常小,约为 0.01 mm。

完成模拟后,检查所有场的实际计算峰值绝对值,并将结果与比例因子进行比较。如果两者相差明显超过一个数量级,请使用新的比例重新计算结果并再次进行比较。

有关变量缩放的更多信息,请参阅 COMSOL Multiphysics Reference Manual 中的 Scaling of Variables and EquationsDependent Variables 章节内容。


请提交与此页面相关的反馈,或点击此处联系技术支持