dynamicsoar's log

主に研究関係のメモ

Fluent: write-settings & read-settings are extremely useful

I'm pretty sure you're tired of repeating the same (or similar) settings for loads of computation cases. At some point you noticed that you can use "Duplicate" the Fluent module in workbench. Yes it's useful. But there's an even better way: settings.

After setting up the Fluent and just before you run the computation, go to TUI window and type

file/write-settings

then you'll be prompted for a file name. Type a name such as "my_settings.ini" then it'll be saved in your working directory (such as D:\my_project_files\dp0\FLU-1\Fluent\ ).

Now you can close the Fluent without saving. Open it again, and go to TUI window, and type in

file/read-settings

and when asked type "my_settings.ini" Voilà! All the settings such as turbulence model, boundary conditions, etc. are recovered.

This is not only useful in the desktop mode but also for the computations on the HPCs with journal file. Within the journal file, you can now simply read the mesh file, read the settings, initialise the flow field, setup the Data File Quantities and Run. For example you can try many different meshes, or you can easily change the inlet velocity in the journal file, etc. Alternatively you can directly edit the setting file (which is a text file with Scheme syntax).

run Fluent, export .cas and .dat, and compress them after computation (on Linux)

I could not find the way to specify the auto-save .cas & .dat files in the format of .cas.gz & .dat.gz, and I gave up to compress them using the journal file. Instead, I decided to compress them in the script file after the computation, if there's any remaining wallclock time. For this I used a simple shell script utilising pigz (parallel version of gzip). If your HPC does not have pigz you can use normal gzip instead but won't get the benefit of parallel compression.

Sample script for pigz

The script will be something like this:

#!/bin/bash
#$ OTHER PARAMETERS REQUIRED BY HPC SYSTEM

export INPUT='my_journal.jou'
N_cores=28

. /etc/profile.d/modules.sh
module load ansys
module load mpi-intel

fluent 3ddp -mpi=intel -g -i ${INPUT} > log.txt 2>&1

wait

for file in $(find . -type f -name '*.dat' -o -name '*.cas'); do
    pigz -p ${N_cores} "$file"
done

Sample script for gzip

Or, if you are using normal gzip, simply:

#!/bin/bash
#$ OTHER PARAMETERS REQUIRED BY HPC SYSTEM

export INPUT='my_journal.jou'

. /etc/profile.d/modules.sh
module load ansys
module load mpi-intel

fluent 3ddp -mpi=intel -g -i ${INPUT} > log.txt 2>&1

wait

for file in $(find . -type f -name '*.dat' -o -name '*.cas'); do
    gzip "$file"
done

micro CT settings memo

I'm using SkyScan 1172. According to one of the Bruker's manual named "SkyScan 1172 How to set up a scan?", for 4K camera mode with No Filter,

  • Voltage = 40--50 kV: but it turned out this resulted in some star-like ray noises. As per the suggestion from the technician, I raised it to 70 kV and it got better.
  • rotation step <= 0.3 deg: "Preferably lower the rotation step (instead of increasing frame averaging) for low dense samples when the signal to noise ratio is too low."
  • frame averaging 4--8 frames: "Preferably increase the frame averaging (instead of decreasing the rotation step) for high dense samples when the signal to noise ratio is too low."

Considering my sample is of very low density material (which does not allow me to use even a thin filter), it is likely that I should decrease rotation step a lot and use moderate number of frames for averaging. However, there's yet another potential consideration that I am suspecting: motion blur. My sample is quite susceptible to the vibration, I can see the blur when I press the "Grab" button immediately after rotation or translation. Therefore, I am suspecting that during the actual scan the first image frame for each position can be slightly blurry. If this is true, increasing frame averaging can be quite important to reduce the noise due to blur. I usually take 0.1--0.15 deg rotation step and 3-5 frame averaging but maybe I should try increasing the frame averaging a bit more.

ANSYS FE Modeler was "undocumented" (removed) in version 19.1

I've been looking for the FE Modeler in version 19.1 and never found it. Uninstalling & reinstalling a few time --> no success. Then, I found that in their release note, it says:

1.8. FE Modeler As we previously announced, FE Modeler has now been undocumented at Release 19.1 because newer ANSYS technologies, such as External Model, have made the FE Modeler application obsolete

Oh... so the External Model should have the similar function... I'll try.

Well, I have never expected a drastic change such as removing a module ("Toolbox") can happen between the 0.1 version difference, which I regarded as minor version up... but for ANSYS it's normal. We should be careful...


日本語: FE Modeler は version 19.1 から消えている。インストールのミスとかではなくて公式が削除した模様。代わりに External Model というのを使えといっている。

ANSYS Mechanical で "core" 数が変えられないとき→メニューとツリーの2箇所変える必要がある(場合がある)

これに気づかなくて最近はずーっとデフォルトらしき2コア(論理コア)でしか並列計算ができてなかった。前はできたこともあったのでバージョン違いのせいか忘れたかのどっちか(あるいは両方)。

とにかくタイトルの通りで、メニューの Tools > Solve Process Settings... からの設定と、左のツリービューアの Solution からの "Number of Cores to Use (beta)" の設定と、2箇所ある。少なくとも version 19.0 ではそうだった。両方をたとえば 16 とかにすれば問題なく 16 論理コアで動く。そんだけ…

と思ったが、全く同じ V19.0 なのにもう一台のマシンだとツリービューの Solution に "Number of Cores to Use (beta)" という項目自体がない!?なんなんだこれ…(頭を抱える)。しかも悪いことにどっちもCPUマザボが同じスペックのPCで、しかも同じタイミングで(つい昨日?)ANSYS をインストールしたんだよね。なにこれ…。唯一の違いとしては片方には先に V19.1 が入っていた、ということ。たぶんここなんだろうな。もうホントやだ…

QNAP NAS (TS-453Be) での port trunking (link aggregation) は不安定?

前提

前提として、QNAP TS-453Be に Toshiba N300 を4つ入れて RAID 5 している。1ヶ月ほど前に導入して、すぐに port trunking を ON にして*1これまでは問題なく使ってきた。たまに接続が切れるな、と思うことはあったが、長くても数分で復帰していたので問題視してこなかった。

PC は Windows 10 & Windows 7 で、これまでに3台からアクセスしたことがある。

トラブルの経過

先程繋がらなくなった際には1時間以上経っても全く復帰せずに困った。Win のエクスプローラはもちろん、web ログインもできなくなり、ping も通らない。なぜか Qfinder からは一応存在が確認できる。ただし見えるだけでほぼ何もできない。再起動すら受け付けない。しょうがないので本体のボタンを押してシャットダウン→再度起動、としたが状況は変わらず。もしかして…?と思い Qfinder から port trunking を解除して個別の Ethernet 扱いに戻すと…(これはなぜかできた)Webログインを始めすべての機能が戻ったようだ。

「普段と違うことをしなかった?」

した。

今日、普段と違うことをしたのは何かと考えると、3つある。

  1. Qfinder の update
  2. SMTP の設定
  3. PC の移動

Qfinder を起動すると更新のお知らせが来たので行った。このとき同時に SMTP の設定をしましょうみたいなダイアログが出ていたので、更新後に設定した。Warning や Error(おそらく RAID の fail や空き容量不足などだろう)がメールで届くとありがたいなと思ったのだった。テストメールは問題なく送信・受信できた。いま思うとこの少しあと(少なくとも数時間以内)に接続が切れたように思う。もう一ついつもと違うこととしては、普段NASへとアクセスしていたPCのうち1台の場所を移動(建物を変えたが同じサブネット内)して、再度NASにアクセスしようとした、ということがある。このときにアクセスできなかったことで、問題の発生に気づいた。いずれかが本当に今回のトラブルに関係しているかは、正直わからないが、今後のためにも記録しておく。Qfinder が一番怪しいか…?

今後の予定

実際問題として、途中の経路に 1 GbE が入っているせいで port trunking の恩恵はほとんどないか、あるとしてもこの不安定性に見合うものではないと判断する。

数年経って 10 GbE が当たり前に普及してくれるだろうことを願う…*2

*1:これは Qfinder からではなく web の管理画面からやったと思う。

*2:10 GbE の PCIe カードと switch と Cat 7 cable は買っていて、高速度カメラからのデータのダウンロードには使っている。しかし離れた建物に置いた NAS へのアクセスとなると経路に必ず 1 GbE が入ってしまうため、そこがボトルネックになる。と思う。