はじめに
計算領域内での流れの滞在時間や、流体の混合の程度を評価できないか、と調べていたところ、libfieldFunctionObjects
のage
というのがあるのを見つけ、ここにそのメモを残しておきます。
使用環境
- 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
という方程式を説いてくれるようです。式中、t がage
、$\phi$は流束を表しています。
ここで、fvSchemesにおいてage
に対してdiv
を設定しなければならないこと、壁面境界条件にはzeroGradient
、その他の境界はinletOutlet
が自動設定されていることに注意が必要です。
設定方法
foamGet 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
の結果例になります。
diffusion true |
diffusion false |
まとめ
age
を使うことにより、流入口からの移動時間を計算することが可能です。
支配方程式で拡散項を考慮していないはずが、設定では拡散項を含めており、ここの確認については今後の課題になります。