LoginSignup
0

More than 3 years have passed since last update.

libfieldFunctionObjectsのageを使った解析例

Last updated at Posted at 2020-12-06

はじめに

計算領域内での流れの滞在時間や、流体の混合の程度を評価できないか、と調べていたところ、libfieldFunctionObjectsageというのがあるのを見つけ、ここにそのメモを残しておきます。

使用環境

  • OpenFOAM-8 (Fundation版)
  • Ubuntu 20 LTS

ageとは

foamInfo ageによると

Solves a transport equation to determine the time taken for a particle to convect from an inlet to the location in the flow.

粒子が流れているとして、流入口からの移動時間を計算してくれるようです(単位は時間になっています)。

また、/opt/openfoam8/src/functionObjects/field/age/age.Hをチェックすると、

Description
    Calculates and writes out the time taken for a particle to travel from an
    inlet to the location. Solves the following equation when incompressible:
    \f[
        \div (\phi t) = 1
    \f]
    where:
    \vartable
        t    | Age [s]
        \phi | Volumetric flux [m^3/s]
    \endvartable
    Boundary conditions are generated automatically as zeroGradient on all
    walls and inletOutlet everywhere else.

Usage
    \table
        Property  | Description                   | Required | Default value
        phi       | The name of the flux field    | no       | phi
        rho       | The name of the density field | no       | rho
        nCorr     | The maximum number of correctors | no       | 5
        schemesField | The name of the field from which schemes are taken | \\
        no | age
        diffusion | Switch to turn on/off the diffusion term | no | off
        tolerance  | Solver residual control       | no       | 1e-5
    \endtable

    \verbatim
    age1
    {
        type            age;
        libs            ("libsolverFunctionObjects.so");

        executeControl  writeTime;
        writeControl    writeTime;

        schemesField    k;
    }
    \endverbatim

のように解説がでてきます。

ここではageという変数を追加し、

div (\phi t) = 1

という方程式を説いてくれるようです。式中、tage、$\phi$は流束を表しています。
ここで、fvSchemesにおいてageに対してdivを設定しなければならないこと、壁面境界条件にはzeroGradient、その他の境界はinletOutletが自動設定されていることに注意が必要です。

設定方法

foamGet age

により、system/以下にageファイルがコピーされます。

system/age
type            age;
libs            ("libfieldFunctionObjects.so");

diffusion       false;
schemesField  U;
//diffusion       true;

executeControl  writeTime;
writeControl    writeTime;

先の支配方程式の説明と矛盾していますが、デフォルトではdiffusion trueとなっていて、拡散項が有効になっています。これをfalseにすると、支配方程式通りの拡散項を無視した解析をしてくれます。schemeFieldは、指定した変数と同じスキームをageにも適用することを意味しています。

使用方法

simpleFoam等を走らせたあとに、

simpleFoam -latestTime -postProcess -func age

とすることにより、最終時刻に対してのageの計算をしてくれます。

使用例

以下はsimpleFoam/roomResidenceTimeの結果例になります。

Screen Shot 2020-12-06 at 23.54.15.png
diffusion true
Screen Shot 2020-12-06 at 23.53.59.png
diffusion false

まとめ

ageを使うことにより、流入口からの移動時間を計算することが可能です。
支配方程式で拡散項を考慮していないはずが、設定では拡散項を含めており、ここの確認については今後の課題になります。

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
0