前言
CFD仿真中常用到一类重要边界条件:Non-Reflecting Boundary (无反射边界)
OpenFOAM中已有两类无反射边界:advective和waveTransmissive
本文参考:https://caefn.com/openfoam/bc-advective-wavetransmissive
一、什么是无反射边界?
无反射边界是指流场中的波(典型的如压力波)通过边界时不产生反射效应,即边界的存在对波的传播没有干扰。
无反射边界条件可表述为
D
ϕ
D
t
=
∂
ϕ
∂
t
+
U
⋅
∇
ϕ
=
0
\frac{D\phi}{Dt}=\frac{\partial \phi}{\partial t}+\bm{U}\cdot \nabla{\phi}=0
DtDϕ=∂t∂ϕ+U⋅∇ϕ=0
OpenFOAM处理非结构网格,考虑边界的法向,因此有如下近似表达式
D
ϕ
D
t
≈
∂
ϕ
∂
t
+
U
n
⋅
∂
ϕ
∂
n
=
0
\frac{D\phi}{Dt} \approx \frac{\partial \phi}{\partial t}+\bm{U_{n}}\cdot \frac{\partial\phi}{\partial n}=0
DtDϕ≈∂t∂ϕ+Un⋅∂n∂ϕ=0
advective和waveTransmissive的区别在于法向速度 U n \bm{U_{n}} Un 的算法,该过程由advectionSpeed()成员函数完成。
二、advective边界
直接采用速度的法向分量。
U n = u n \bm{U_{n}} = u_{n} Un=un
advectiveFvPatchField类中advectionSpeed()的实现
template<class Type>
Foam::tmp<Foam::scalarField>
Foam::advectiveFvPatchField<Type>::advectionSpeed() const
{
const surfaceScalarField& phi =
this->db().objectRegistry::template lookupObject<surfaceScalarField>
(phiName_);
fvsPatchField<scalar> phip =
this->patch().template lookupPatchField<surfaceScalarField, scalar>
(
phiName_
);
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchScalarField& rhop =
this->patch().template lookupPatchField<volScalarField, scalar>
(
rhoName_
);
return phip/(rhop*this->patch().magSf());
}
else
{
return phip/this->patch().magSf();
}
}
三、waveTransmissive边界
采用速度的法向分量与声速的和。
U
n
=
u
n
+
c
=
u
n
+
γ
/
ψ
\bm{U_{n}} = u_{n}+c=u_{n}+\sqrt{\gamma/\psi}
Un=un+c=un+γ/ψ
其中
γ
\gamma
γ 为绝热指数,
ψ
\psi
ψ 为压缩系数(compressibility)
waveTransmissiveFvPatchField类中advectionSpeed()的实现
template<class Type>
Foam::tmp<Foam::scalarField>
Foam::waveTransmissiveFvPatchField<Type>::advectionSpeed() const
{
// Lookup the velocity and compressibility of the patch
const fvPatchField<scalar>& psip =
this->patch().template
lookupPatchField<volScalarField, scalar>(psiName_);
const surfaceScalarField& phi =
this->db().template lookupObject<surfaceScalarField>(this->phiName_);
fvsPatchField<scalar> phip =
this->patch().template
lookupPatchField<surfaceScalarField, scalar>(this->phiName_);
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
{
const fvPatchScalarField& rhop =
this->patch().template
lookupPatchField<volScalarField, scalar>(this->rhoName_);
phip /= rhop;
}
// Calculate the speed of the field wave w
// by summing the component of the velocity normal to the boundary
// and the speed of sound (sqrt(gamma_/psi)).
return phip/this->patch().magSf() + sqrt(gamma_/psip);
}
个人认为,waveTransmissive边界更适用于可压缩流动,因为它考虑了声速的影响。
Contact me
E-mail: 18810577380@163.com