9. 9
SRFVelocity
void Foam::SRFVelocityFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
// If not relative to the SRF include the effect of the SRF
if (!relative_)
{
// Get reference to the SRF model
const SRF::SRFModel& srf =
db().lookupObject<SRF::SRFModel>("SRFProperties");
// Determine patch velocity due to SRF
const vectorField SRFVelocity(srf.velocity(patch().Cf()));
operator==(-SRFVelocity + inletValue_);
}
// If already relative to the SRF simply supply the inlet value as a fixed
// value
else
{
operator==(inletValue_);
}
fixedValueFvPatchVectorField::updateCoeffs();
}
“relative” を “no” に設定した場合
𝜴 × 𝒓 の計算
𝒖 𝑅 = −𝜴 × 𝒓 + 𝒖
“relative” を “yes” に設定した場合
SRFModel.C の 160 行目
13. 13
flowRateInletVelocity
void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
const scalar t = db().time().timeOutputValue();
// a simpler way of doing this would be nice
const scalar avgU = -flowRate_->value(t)/gSum(patch().magSf());
tmp<vectorField> n = patch().nf();
if (volumetric_ || rhoName_ == "none")
{
// volumetric flow-rate or density not given
operator==(n*avgU);
}
設定した流量を境界面積で
割り,平均流速 avgU を計算
境界単位法線ベクトル(領域外向き)
設定された体積流量から境界上の流速を計算しているコード
• この境界条件は流入境界での使用を想定しているため,流量を正の値に設定した場合に,流速の向
きが計算領域内を向くように,avgU の計算式にマイナス符号が付いています.
境界上の流速を平均流速×単位法線ベクトルで計算