dynamicsoar's log

主に研究関係のメモ

ORS Dragonfly 2021.1 での Window Leveling の挙動について

ORS Dragonfly は自分が使っている CT 画像(正確には処理後の断面画像群)から3次元形状を再構築したりするソフトで、非商用なら無料で使える。

最近、version 4 から 2021.1 へアプデしたのだけれど、いわゆる threshold のとり方の挙動が version 4 以前とは変わっていて、混乱したのでメモしておく。

Threshold を変えることを Dragonfly では Leveling と呼ぶが、この挙動が 2020 で変わり、デフォルトでは右端のバーが動かせなくなった。設定で Use new rendering engine の tick を外しても挙動が変わらず、バグかと思ってレポートしたら、丁寧に version 2021.1 リリースノートの27ページを見てね、と教えてくれた(ライセンス的にはサポート外なのに)。

Dragonfly | New Features and Enhancements | ORS

要は、右の方にある 3D settings ペインにあるボタンを切り替えることで、以前のような挙動や、さらには threshold で断ち切るのではなく重み付けのようなことまで選べるようになっていたようだ。これは嬉しい。

ただ、ボタンの場所が直感的にわかりづらすぎる。デフォルトだと Window Leveling は左上にあり、3D settings は右下にある。かなり離れている。次のバージョンでまたちょっと変えるということを言っていたので、このあたりのUIの改善も入るのかもしれない。

ANSYS Mechanical Applictaion (Workbench) で、ある1点の位置の probe は user defined results > LOC_DEFX

f:id:dynamicsoar:20210430225716p:plain
LOC_DEFY

タイトルのとおり。正確には、LOC_DEFX, LOC_DEFY, LOC_DEFZ で x, y, z 成分。

ここで知った: https://forum.ansys.com/discussion/comment/23058/#Comment_23058

ある点の座標の probe なんて超基本的で需要もあると思うんだけど、組み込みの結果で選べないのはかなり謎。

ANSYS student のライセンスタイプは ANSYS Academic Teaching Introductory

f:id:dynamicsoar:20210423012242p:plain
licenses for ANSYS Mechanical background job

最近 ANSYS Mechanical のマニュアルを見て、デスクトップで計算するとき、「大規模なジョブは foreground(Solver Process Settings でいう My Computer)では回すなよ、background (My Computer, Background) で回せよ」って書いてあることにいまさら気づいた。どうも foreground で回すと Workbench に紐付けみたいにされてしまうために動作が遅くなるし色々制約があるが、background 動作にするとこの辺が改善するっぽい。なんかそんな気はしていた。

そこでいつものように student version(demo version みたいなもの)でサクサク試してみようと思ったけど、どのライセンスを選べばいいんだ??となった。Student という名前のものはないんだよね。もちろん、ここのライセンス選択に失敗すると job が走らない。

結論としてはライセンスファイルを見ればよくて、それは C:\Program Files\ANSYS Inc\ANSYS Student\Shared Files\Licensing に置いてある。そうすると1行目に

# The following key is for 'ANSYS Academic Teaching Introductory'

と書いてあるのでこれです。

なお background で進行中のジョブは workbench のメニューの Jobs > Open Job Monitor... で見れるっぽい(または Workbench 下のバーからも開ける)。

超小規模なテスト計算では foreground 1 min 53 s; background 1 min 41 s だったので多少の高速化も期待できるのかも…?

matplotlib で scientific notation しつつ "x 10^n" を書くやつ、を ax でやる

y-axis だけ。

formatter = ScalarFormatter()
ax.yaxis.set_major_formatter(formatter)
ax.ticklabel_format(axis='y', style='sci', scilimits=(0,0), useOffset=None, useLocale=None, useMathText=True)

こんだけのことがなかなかわからずだいぶさまよった…

ANSYS でライセンス認証に失敗するときの対処法(のひとつ)→ License Preferences で Reset to Default

問題の概要と対処

これまで 19.1 を使っていたのだけれど、そろそろ 2019R3 (19.5) に上げるかーと思ってやってみたら、インストール自体は完了したのになぜかライセンスがうまく取れずに失敗する。サーバとクライアントが同じマシンでも失敗するので、Firewall の問題ではない。まさかうちのライセンスは 19.1 までしか使えないのか?と不安になってサポートに相談したら、以下の対処をすすめられた:

  • 2019 R3 License Preferences for User を開く(Windowes のスタートメニューから User License Preferences 2019 R3 でもいいし、Workbench のメニューバー Tools > License Preferences... でもよい、と思う)
  • 下に並んだボタンのうち、右から2つ目の "Reset to Default" を押す

こんだけ。「そんなので直るわけ…直ったー!」ってなりました。半日くらい色々調べてもダメだったけどこれで直った。たまにはサポートも役に立つなぁ…たぶんこういうライセンス関係の相談は数え切れないほど受けていて慣れてるんだろうな。それに比べてUDFの質問とかには(ry

別件:古いサーバのポート番号が Windows環境変数に残っていた

あとちょっとこれとは別の問題として、サーバのマシンをけっこう前に変えたんだけど、古いマシンのポート番号が残っていて毎回トライされていて気持ち悪かったのだけど、設定ファイルのどこにも見当たらない。色々調べててようやく見つけたのが、Windows環境変数。Win 10 なら、スタートメニューで enviro くらいまで打てば Edit environment variables for your account が出てきて、これで環境変数をいじれる。ここに旧サーバのポート番号が残っていたので消したら、トライすることがなくなった。

ANSYS Fluent: you should probably not use hybrid initialisation for transient, if there are 2 or more outlets

f:id:dynamicsoar:20200423211703p:plain
Effect of the initialisation methods on streamlines.

Where there are two outlets, and you are computing transient simulation with ANSYS Fluent, you should probably not use hybrid initialisation. Or at least you should be careful and check the resulting flow field before proceeding. The hybrid initialisation, as far as I understand it, can be "smarter" guess of the initial flow field so the convergence would possibly be quicker. However, as shown in the figure, where I just wanted the uniform flow to be slanted so the wing (too tiny to see) experiences some positive (or negative) AoA, the hybrid initialisation can result in unwanted flow field, whereas the standard one results in appropriate flow field.

This behaviour is apparently independent of the mesh density. Actually the figure shown above is the one computed in the student version of ANSYS (I initially encountered the problem in the "real" simulation but just wanted to test with much simpler situation as it's much quicker for debugging).

Using US keyboard but cannot remove UK keyboard from lang list --> install English (United Kingdom) *language* then delete it

After the update to the latest build of the Windows 10 (that I applied today), the languages went back to the default, which is a mess. I'm using a US keyboard but somehow the UK keyboard appears on the language list, perhaps something to do with the fact that I'm living in the UK. I need this language list as I need to quite often change the langs between English and Japanese.

Googled a bit, and found this thread:

answers.microsoft.com

Not to be confused with the UK keyboard layout for English (United States). Adding this or removing this won't affect at all. Instead, you should press the button "+ Add a preferred language" and add "English (United Kingdom)". You can untick as much as possible. When installed, delete it. This worked for me.