InterFoam求解孔隙尺度气液两相流中气泡内形成漩涡应如何解决
-
@学流体的小明 拜托下能否给看下我的边界条件是否准确
/--------------------------------- C++ -----------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 2312 |
| \ / A nd | Website: www.openfoam.com |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
arch "LSB;label=32;scalar=64";
class volScalarField;
location "0";
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //dimensions [0 0 0 0 0 0 0];
internalField uniform 1;
boundaryField
{
walls
{
type zeroGradient;
}
inLet
{
type codedFixedValue;
value uniform 1;
name inletProfile2;
code #{
const fvPatch& boundaryPatch = patch();
const vectorField& Cf = boundaryPatch.Cf();
scalarField& field = *this;scalar miny1 = 0.0e-3; scalar maxy1 = 0.005e-3;//gas两个数中间进气 scalar miny2 = 0.01e-3; scalar maxy2 = 0.015e-3;//gas两个数中间进气 scalar miny3 = 0.02e-3; scalar maxy3 = 0.025e-3;//gas两个数中间进气 scalar miny4 = 0.03e-3; scalar maxy4 = 0.035e-3;//gas两个数中间进气 scalar miny5 = 0.04e-3; scalar maxy5 = 0.045e-3;//gas两个数中间进气 scalar miny6 = 0.05e-3; scalar maxy6 = 0.055e-3;//gas两个数中间进气 scalar miny7 = 0.06e-3; scalar maxy7 = 0.065e-3;//gas两个数中间进气 scalar miny8 = 0.07e-3; scalar maxy8 = 0.075e-3;//gas两个数中间进气 scalar miny9 = 0.08e-3; scalar maxy9 = 0.085e-3;//gas两个数中间进气 scalar miny10 = 0.09e-3; scalar maxy10 = 0.095e-3;//gas两个数中间进气 forAll(Cf , faceI) { if( (Cf[faceI].y() > miny1) && (Cf[faceI].y() < maxy1) ) { field[faceI] = 0; } if( (Cf[faceI].y() > miny2) && (Cf[faceI].y() < maxy2) ) { field[faceI] = 0; } if( (Cf[faceI].y() > miny3) && (Cf[faceI].y() < maxy3) ) { field[faceI] = 0; } if( (Cf[faceI].y() > miny4) && (Cf[faceI].y() < maxy4) ) { field[faceI] = 0; } if( (Cf[faceI].y() > miny5) && (Cf[faceI].y() < maxy5) ) { field[faceI] = 0; } if( (Cf[faceI].y() > miny6) && (Cf[faceI].y() < maxy6) ) { field[faceI] = 0; } if( (Cf[faceI].y() > miny7) && (Cf[faceI].y() < maxy7) ) { field[faceI] = 0; } if( (Cf[faceI].y() > miny8) && (Cf[faceI].y() < maxy8) ) { field[faceI] = 0; } if( (Cf[faceI].y() > miny9) && (Cf[faceI].y() < maxy9) ) { field[faceI] = 0; } if( (Cf[faceI].y() > miny10) && (Cf[faceI].y() < maxy10) ) { field[faceI] = 0; } } #}; } outLet { type zeroGradient; } front { type empty; } back { type empty; } sand { type constantAlphaContactAngle; theta0 45; limit gradient; value uniform 0; } //hydrate //{ // type constantAlphaContactAngle; // theta0 34; // limit gradient; // value uniform 0; //} clay { type constantAlphaContactAngle; theta0 24; limit gradient; value uniform 0; }
}
// ************************************************************************* //
/--------------------------------- C++ -----------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 2312 |
| \ / A nd | Website: www.openfoam.com |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inLet
{
type fixedFluxPressure;
}
outLet
{
type fixedValue;
value uniform 0; // 指定出口压力
}walls { type zeroGradient; } front { type empty; } back { type empty; } sand { type zeroGradient; } //hydrate //{ // type fixedFluxPressure; //} clay { type zeroGradient; }
}
// ************************************************************************* //
/--------------------------------- C++ -----------------------------------
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 2312 |
| \ / A nd | Website: www.openfoam.com |
| \/ M anipulation | |
*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inLet
{
type codedFixedValue;
value uniform (1e-2 0 0);//液体速度
name inletProfile1;code #{ const fvPatch& boundaryPatch = patch(); const vectorField& Cf = boundaryPatch.Cf(); vectorField& field = *this; scalar miny1 = 0.0e-3; scalar maxy1 = 0.005e-3;//gas两个数中间进气 scalar miny2 = 0.01e-3; scalar maxy2 = 0.015e-3;//gas两个数中间进气 scalar miny3 = 0.02e-3; scalar maxy3 = 0.025e-3;//gas两个数中间进气 scalar miny4 = 0.03e-3; scalar maxy4 = 0.035e-3;//gas两个数中间进气 scalar miny5 = 0.04e-3; scalar maxy5 = 0.045e-3;//gas两个数中间进气 scalar miny6 = 0.05e-3; scalar maxy6 = 0.055e-3;//gas两个数中间进气 scalar miny7 = 0.06e-3; scalar maxy7 = 0.065e-3;//gas两个数中间进气 scalar miny8 = 0.07e-3; scalar maxy8 = 0.075e-3;//gas两个数中间进气 scalar miny9 = 0.08e-3; scalar maxy9 = 0.085e-3;//gas两个数中间进气 scalar miny10 = 0.09e-3; scalar maxy10 = 0.095e-3;//gas两个数中间进气 forAll(Cf , faceI) { if( (Cf[faceI].y() > miny1) && (Cf[faceI].y() < maxy1) ) { field[faceI] = vector(1e-2, 0, 0);//气体速度 } if( (Cf[faceI].y() > miny2) && (Cf[faceI].y() < maxy2) ) { field[faceI] = vector(1e-2, 0, 0);//气体速度 } if( (Cf[faceI].y() > miny3) && (Cf[faceI].y() < maxy3) ) { field[faceI] = vector(1e-2, 0, 0);//气体速度 } if( (Cf[faceI].y() > miny4) && (Cf[faceI].y() < maxy4) ) { field[faceI] = vector(1e-2, 0, 0);//气体速度 } if( (Cf[faceI].y() > miny5) && (Cf[faceI].y() < maxy5) ) { field[faceI] = vector(1e-2, 0, 0);//气体速度 } if( (Cf[faceI].y() > miny6) && (Cf[faceI].y() < maxy6) ) { field[faceI] = vector(1e-2, 0, 0);//气体速度 } if( (Cf[faceI].y() > miny7) && (Cf[faceI].y() < maxy7) ) { field[faceI] = vector(1e-2, 0, 0);//气体速度 } if( (Cf[faceI].y() > miny8) && (Cf[faceI].y() < maxy8) ) { field[faceI] = vector(1e-2, 0, 0);//气体速度 } if( (Cf[faceI].y() > miny9) && (Cf[faceI].y() < maxy9) ) { field[faceI] = vector(1e-2, 0, 0);//气体速度 } if( (Cf[faceI].y() > miny10) && (Cf[faceI].y() < maxy10) ) { field[faceI] = vector(1e-2, 0, 0);//气体速度 } } #}; } outLet { type zeroGradient; } walls { type noSlip; } front { type empty; } back { type empty; } sand { type noSlip; } //hydrate //{ //type noSlip; //} clay { type noSlip; }
}
// ************************************************************************* //