边界条件及初始条件
此波浪算例所需的初始条件有alpha.water p_rgh U。
1、alpha.water.orig文件
$ cat 0/alpha.water.orig
...
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
"(right|bottom)"
{
type zeroGradient;
}
left
{
type waveAlpha; //造波边界,与waves2Foam类似,均为waveAlpha,不过所需的参数不同。
U U;
inletOutlet true;//猜测此项表示此边界可以允许流体进出
}
top
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
}
// ************************************************************************* //
其中waveAlpha类型中的inletOutlet参数不太理解,于是查看了该边界条件的定义文件。
通过以下命令:
$ grep -rn waveAlpha $FOAM_SRC
...
/opt/openfoam8/src/waves/derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.H:28: This boundary condition provides a waveAlpha condition. This sets the phase
...
找到源代码路径,然后打开查看文件头,其中会有该边界条件的描述。此处引用过来
Description
This boundary condition provides a waveAlpha condition. This sets the phase
fraction to that specified by a superposition of wave models. All the
wave modelling parameters are obtained from a centrally registered
waveSuperposition class.
Flow reversal will occur in the event that the amplitude of the velocity
oscillation is greater than the mean flow. This triggers special handling,
the form of which depends on the inletOutlet flag and whether a wave
pressure condition is being used.
If a wave pressure condition is not being used, the inletOutlet switches
between a fixedValue and an inletOutlet condition, with the value given by
the wave model. If fixedValue, the result may be more accurate, but it
might also be unstable.
If a wave pressure condition is being used, then the normal phase fraction
condition becomes fixedGradient on outlet faces. This gradient is
calculated numerically by evaluating the wave model on both the patch face
and the adjacent cell.
没太理解。
2、p_rgh文件
$ cat 0/p_rgh
...
FoamFile
{
format ascii;
class volScalarField;
location "0";
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
"(left|right|bottom)"
{
type fixedFluxPressure;
value uniform 0;
}
top
{
type totalPressure;
p0 uniform 0;
}
}
// ************************************************************************* //
都是些常规的边界条件。
3、U.org文件
$ cat 0/U.org
...
FoamFile
{
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (2 0 0);
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
left
{
type waveVelocity; //波浪速度
}
right
{
type outletPhaseMeanVelocity;
UnMean 2; //流速
alpha alpha.water; //指定水,而不是空气
}
top
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
bottom
{
type noSlip;
}
}
// ************************************************************************* //
0文件夹下初始条件在setWave命令作用下,生成计算中使用的初始条件。
本文详细介绍了OpenFOAM中进行波浪模拟时的初始条件和边界条件设置。内容涉及alpha.water.orig文件中的waveAlpha边界条件,讨论了inletOutlet参数的作用,以及其在不同情况下的行为。同时,还展示了p_rgh和U.org文件中的流体压力和速度初始设定,包括固定流速、总压入口和无滑移边界条件。这些设置对于理解和实现复杂的水动力学模拟至关重要。

2989

被折叠的 条评论
为什么被折叠?



