大変お世話になります。
粒子径分布の設定を試しました。
OpenFOAM: Foam::distributionModels Namespace Reference
例えばこの中のnormal(正規分布)にした場合の例です。
以下、MPPICFoam/Goldschmidtを以下のように変更
constant/kinematicCloudProperties
injectionModels
{
model1
{
type manualInjection;
massTotal 0;
parcelBasisType fixed;
nParticle 1;
SOI 0;
positionsFile "kinematicCloudPositions";
U0 (0 0 0);
sizeDistribution
{
// type fixedValue;
// fixedValueDistribution
// {
// value 0.0025;
// }
type normal;
normalDistribution
{
expectation 0.0025; //mu
variance 0.00025; //sigma
minValue 0.001;
maxValue 0.005;
}
}
}
}
※平均値と標準偏差がマニュアルと違ったので注意
粒子径情報は各時刻で出力されるので出力してヒストグラムにしてみました。
0.01/lagrangian/kinematicCloud/
type generalだと実験のデータとかも設定できそうです。
粒子分布グラフ作成用Pythonプログラム
======================
import numpy as np
import matplotlib.pyplot as plt
# ファイルパスを定義
file_path = '0.01/lagrangian/kinematicCloud/d'
# ファイルを読み込む
with open(file_path, 'r') as file:
lines = file.readlines()
# スカラー値の開始位置を特定(ヘッダー部分をスキップ)
start_index = lines.index('(\n') + 1
# スカラー値を抽出
scalar_values = []
for line in lines[start_index:]:
stripped_line = line.strip()
# 行が空でなく、終了を示す括弧でなく、数値に変換可能な場合、値を追加
try:
scalar_values.append(float(stripped_line))
except ValueError:
# 数値に変換できない場合はスキップ
continue
# NumPy配列に変換
scalar_values = np.array(scalar_values)
# ヒストグラムを作成
plt.hist(scalar_values, bins=30, edgecolor='black')
plt.title('histgram')
plt.xlabel('d[m]')
plt.ylabel('frequency')
# プロットを表示
plt.show()
======================
よろしくお願いします。
--
このメールは Google グループのグループ「OpenFOAM」に登録しているユーザーに送られています。
このグループから退会し、グループからのメールの配信を停止するには openfoam+u...@googlegroups.com にメールを送信してください。
このディスカッションを表示するには、https://groups.google.com/d/msgid/openfoam/a211a66b-28f2-491f-90a4-7e68e5c6d8bbn%40googlegroups.com にアクセスしてください。
このディスカッションを表示するには、https://groups.google.com/d/msgid/openfoam/CAEAawWEdoFM6_bThsEwfmLmNs6rqkx-9Y7MmdQPOyDvTCYtk0A%40mail.gmail.com にアクセスしてください。