边界条件及初始条件
此波浪算例所需的初始条件有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
命令作用下,生成计算中使用的初始条件。