LoginSignup

This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 5 years have passed since last update.

[STAR-CCM+ on Rescale] STEP6: ポストプロセッシング

Last updated at Posted at 2017-01-26

1. ポストプロセッシングスクリプトの設定

1.1 post.shのアップロードと実行コマンド

ソルバー実行が終わったあと、ここでアップロードされるスクリプトが各ケース毎に実行されます。
post.shのアップロードが完了したら、"ポストプロセッシングコマンド" を以下のように入力してください。

ポストプロセッシングコマンド
dos2unix ./post.sh
./post.sh

Kobito.3S42LY.png

1.2. post.shの内容確認

  • Rescaleでは、標準出力の内容はprocess_output.logに保存されています。
  • 今回、トルクとoutletの質量流量が標準出力に表示されるように設定しています。
  • post.sh では、最終ステップにおけるこの二つの値をシェルスクリプトで抜き出しています。
  • 計算が終了すると Stopping criterion Maximum Steps satisfied. が表示されるため、この一つ上の数値を抜き出しています。
process_output.logの例
~~~~ 省略 ~~~~
[2017-01-18T06:14:46Z]:      Iteration     Continuity     X-momentum     Y-momentum     Z-momentum            Tke            Tdr OF1_MassFlowOutlet     OF2_Torque 
[2017-01-18T06:14:46Z]:            341   8.563288e-03   5.825719e-03   5.867570e-03   4.756399e-03   4.269799e-05   2.686300e-03       1.999357e+00   3.919696e-02
~~~~ 省略 ~~~~
[2017-01-18T06:14:47Z]:            350   6.479600e-03   4.368355e-03   3.764447e-03   2.962352e-03   4.228104e-05   2.433925e-03       1.999209e+00   3.919743e-02 
[2017-01-18T06:14:47Z]: Stopping criterion Maximum Steps satisfied.
[2017-01-18T06:14:47Z]: Auto save: sampleV1106@00350.sim
[2017-01-18T06:14:47Z]: Saving: sampleV1106@00350.sim
~~~~ 省略 ~~~~
post.sh
#!/bin/sh

FILE="./process_output.log"
STR=$(cat ${FILE} | \
    grep -v "Reversed flow on" | \
    grep -B 1 "Stopping criterion Maximum Steps satisfied." | \
    head -1)

OF1_MassFlowOutlet=$(echo $STR | awk '{print $(NF-1)}')
OF2_Torque=$(echo $STR | awk '{print $NF}')

printf "%s\t%s\n" "OF1_MassFlowOutlet" "${OF1_MassFlowOutlet}"
printf "%s\t%s\n" "OF2_Torque" "${OF2_Torque}"

完了: 次のステップへ

一度トップ画面に戻って次へ進んでください。

0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up