LoginSignup
4
3

More than 1 year has passed since last update.

OpenFOAMにおける非定常境界条件の設定方法

Last updated at Posted at 2021-01-18

はじめに

本記事ではOpenFOAM v8での非定常境界条件(time-varying boundary condition)の設定方法、特に速度変動の設定についてまとめます。元記事は、Foundationのこちらのページになります。

なお、以下ではpimpleFoam/pitzDailyを使用しています。

速度一定

0/U
    inlet
    {
        type            fixedValue;
        value           uniform (10 0 0);
    }

sine周期

sine.gif

0/U
    inlet
    {
        type            uniformFixedValue;
        uniformValue    sine;
        uniformValueCoeffs
        {
            frequency       10;
            scale           (1 0 0);
            amplitude       (2 0 0);
            level           (10 0 0);
        }
    }

方形波

square.gif

0/U
    inlet
    {
        type         uniformFixedValue;
        uniformValue
        {
    ¦       type             square;
    ¦       frequency        10;
    ¦       scale            (1 0 0);  // Scale factor for wave
    ¦       amplitude        (3 0 0);
    ¦       level            (10 0 0);  // Offset
        }
    }

テーブル

table.gif

0/Uでの入力

0/U
   inlet
   {
      type            uniformFixedValue;
      uniformValue    table
      (
        (0 (0.0 0 0))
        (0.1 (1 0 0))
        (0.2 (2 0 0))
        (0.3 (3 0 0))
        (0.4 (4 0 0))
        (0.5 (5 0 0))
        (0.6 (4 0 0))
        (0.7 (3 0 0))
        (0.8 (2 0 0))
        (0.9 (1 0 0))
        (1.0 (0 0 0))
       );
       outOfBounds   clamp;
   }

Tableで規定された以降の条件は、Tableの最終時刻の値が反映されるようです。
これをリピートしたいなどは、outOfBoundsの設定をrepeat;errorwarnにします。

ファイルでの入力

0/U
    inlet
    {
        type         uniformFixedValue;
        uniformValue
        {
            type             tableFile;
            file             "./0/dataTable.txt";
        }
    }
dataTable.txt
(
        (0 (0.0 0 0))
        (0.1 (1 0 0))
        (0.2 (2 0 0))
        (0.3 (3 0 0))
        (0.4 (4 0 0))
        (0.5 (5 0 0))
        (0.6 (4 0 0))
        (0.7 (3 0 0))
        (0.8 (2 0 0))
        (0.9 (1 0 0))
        (1.0 (0 0 0))
);

テーブルファイルの記載方法は、こちらを参考にすると良いです。

まとめ

主要なものだけですが、非定常境界条件の設定方法をまとめてみました。
以前のバージョンではcsvの読み込みができていたのですが、v8ではtableFileに統合されてしまったようです。chemkinファイルの直接の読み込みもできなくなっていますし、Foundationの開発方針が反映されているのでしょうか・・・。なくさなくても・・・と思わなくもないです。

参考サイト

4
3
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
4
3