diff --git a/perpendicular-flap/fluid-openfoam/0/U b/perpendicular-flap/fluid-openfoam/0/U index 5ad191331..12661a122 100644 --- a/perpendicular-flap/fluid-openfoam/0/U +++ b/perpendicular-flap/fluid-openfoam/0/U @@ -8,7 +8,7 @@ FoamFile dimensions [0 1 -1 0 0 0 0]; -internalField uniform (10 0 0); +internalField uniform (100 0 0); boundaryField { diff --git a/perpendicular-flap/fluid-openfoam/0/k b/perpendicular-flap/fluid-openfoam/0/k new file mode 100644 index 000000000..dad3c6114 --- /dev/null +++ b/perpendicular-flap/fluid-openfoam/0/k @@ -0,0 +1,66 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2406 | +| \\ / 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 k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 50; + +boundaryField +{ + + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + + flap + { + type kqRWallFunction; + value $internalField; + } + + frontAndBack + { + type empty; + } + + upperWall + { + type zeroGradient; + } + + lowerWall + { + type zeroGradient; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/perpendicular-flap/fluid-openfoam/0/nut b/perpendicular-flap/fluid-openfoam/0/nut new file mode 100644 index 000000000..e6d815a28 --- /dev/null +++ b/perpendicular-flap/fluid-openfoam/0/nut @@ -0,0 +1,52 @@ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} + +dimensions [ 0 2 -1 0 0 0 0 ]; + +internalField uniform 5; + +boundaryField +{ + + inlet + { + type calculated; + value uniform 0; + } + + outlet + { + type calculated; + value uniform 0; + } + + flap + { + type nutkWallFunction; + value uniform 0; + } + + frontAndBack + { + type empty; + } + + upperWall + { + type calculated; + value uniform 0; + } + + lowerWall + { + type calculated; + value uniform 0; + } + +} + diff --git a/perpendicular-flap/fluid-openfoam/0/omega b/perpendicular-flap/fluid-openfoam/0/omega new file mode 100644 index 000000000..a793a2bae --- /dev/null +++ b/perpendicular-flap/fluid-openfoam/0/omega @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2406 | +| \\ / 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 omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform 80; + +boundaryField +{ + + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + + flap + { + type omegaWallFunction; + blending binomial; + n 2; + value uniform 80; + } + + upperWall + { + type zeroGradient; + } + + lowerWall + { + type zeroGradient; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/perpendicular-flap/fluid-openfoam/constant/transportProperties b/perpendicular-flap/fluid-openfoam/constant/transportProperties index 5383adaad..417037381 100644 --- a/perpendicular-flap/fluid-openfoam/constant/transportProperties +++ b/perpendicular-flap/fluid-openfoam/constant/transportProperties @@ -8,4 +8,4 @@ FoamFile transportModel Newtonian; -nu nu [ 0 2 -1 0 0 0 0 ] 1; +nu nu [ 0 2 -1 0 0 0 0 ] 1e-5; diff --git a/perpendicular-flap/fluid-openfoam/constant/turbulenceProperties b/perpendicular-flap/fluid-openfoam/constant/turbulenceProperties index 592f6d52d..c7daecac4 100644 --- a/perpendicular-flap/fluid-openfoam/constant/turbulenceProperties +++ b/perpendicular-flap/fluid-openfoam/constant/turbulenceProperties @@ -6,4 +6,11 @@ FoamFile object turbulenceProperties; } -simulationType laminar; +simulationType RAS; + +RAS +{ + RASModel kOmegaSST; + turbulence on; + printCoeffs on; +} diff --git a/perpendicular-flap/fluid-openfoam/run.sh b/perpendicular-flap/fluid-openfoam/run.sh index 8f55fbfa5..05309549e 100755 --- a/perpendicular-flap/fluid-openfoam/run.sh +++ b/perpendicular-flap/fluid-openfoam/run.sh @@ -5,6 +5,8 @@ set -e -u exec > >(tee --append "$LOGFILE") 2>&1 blockMesh +topoSet +refineMesh -overwrite ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs diff --git a/perpendicular-flap/fluid-openfoam/system/blockMeshDict b/perpendicular-flap/fluid-openfoam/system/blockMeshDict index 875f42294..0771137f0 100644 --- a/perpendicular-flap/fluid-openfoam/system/blockMeshDict +++ b/perpendicular-flap/fluid-openfoam/system/blockMeshDict @@ -9,7 +9,7 @@ FoamFile x0 -3.; x1 -0.05; x2 0.05; -x3 3.; +x3 6.; y0 0.; y1 1.; @@ -48,8 +48,9 @@ vertices ); // Grading -h1 30; -h2 3; +h1 20; +h2 1; +h3 40; v1 15; v2 30; @@ -60,7 +61,7 @@ blocks simpleGrading (0.5 1 1) hex ( 2 3 7 6 14 15 19 18 ) - ($h1 $v1 1) + ($h3 $v1 1) simpleGrading (2 1 1) hex ( 4 5 9 8 16 17 21 20 ) @@ -72,7 +73,7 @@ blocks simpleGrading (1 2 1) hex ( 6 7 11 10 18 19 23 22 ) - ($h1 $v2 1 ) + ($h3 $v2 1 ) simpleGrading (2 2 1) ); diff --git a/perpendicular-flap/fluid-openfoam/system/controlDict b/perpendicular-flap/fluid-openfoam/system/controlDict index 9d35646a2..1156ff605 100644 --- a/perpendicular-flap/fluid-openfoam/system/controlDict +++ b/perpendicular-flap/fluid-openfoam/system/controlDict @@ -37,6 +37,18 @@ timePrecision 6; functions { + limitKOmega + { + // Mandatory entries (unmodifiable) + type limitFields; + libs (fieldFunctionObjects); + + // Mandatory entries (runtime modifiable) + fields (omega k); + limit max; + max 1e7; + } + preCICE_Adapter { type preciceAdapterFunctionObject; diff --git a/perpendicular-flap/fluid-openfoam/system/fvSchemes b/perpendicular-flap/fluid-openfoam/system/fvSchemes index 80c096192..5d636d5d7 100644 --- a/perpendicular-flap/fluid-openfoam/system/fvSchemes +++ b/perpendicular-flap/fluid-openfoam/system/fvSchemes @@ -20,6 +20,9 @@ divSchemes { default none; div(phi,U) bounded Gauss upwind; + div(phi,k) bounded Gauss limitedLinear 1; + div(phi,omega) bounded Gauss upwind; + div((nuEff*dev2(T(grad(U))))) Gauss linear; } @@ -37,3 +40,8 @@ snGradSchemes { default corrected; } + +wallDist +{ + method Poisson; +} diff --git a/perpendicular-flap/fluid-openfoam/system/fvSolution b/perpendicular-flap/fluid-openfoam/system/fvSolution index 064d7f372..f1bee56df 100644 --- a/perpendicular-flap/fluid-openfoam/system/fvSolution +++ b/perpendicular-flap/fluid-openfoam/system/fvSolution @@ -54,22 +54,55 @@ solvers $U; relTol 0; } + + "(U|epsilon|k|omega)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 1e-3; + // minIter 100; + } + "(U|k|epsilon|omega)Final" + { + $U; + tolerance 1e-6; + relTol 0; + minIter 2; + } + + yPsi + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-5; + relTol 0; + } + + yPsiFinal + { + $yPsi + relTol 0; + } } PIMPLE { - nCorrectors 4; + nCorrectors 2; nNonOrthogonalCorrectors 1; // tolerance 1.0e-14; // relTol 5e-3; consistent true; correctPhi true; momentumPredictor true; - nOuterCorrectors 1; + nOuterCorrectors 2; } - -potentialFlow +relaxationFactors { - nNonOrthogonalCorrectors 10; + equations + { + "k.*" 0.4; + "omega.*" 0.4; + } } diff --git a/perpendicular-flap/fluid-openfoam/system/refineMeshDict b/perpendicular-flap/fluid-openfoam/system/refineMeshDict new file mode 100644 index 000000000..2fa67ef7c --- /dev/null +++ b/perpendicular-flap/fluid-openfoam/system/refineMeshDict @@ -0,0 +1,32 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object refineMeshDict; +} + +set refinementZoneVer; + +globalCoeffs +{ + tan1 (1 0 0); + tan2 (0 1 0); +} + +directions +( + tan1 + // tan2 +); + +coordinateSystem global; +geometricCut false; + +// Whether to refine cells attached to a patch +// in the normal direction into the domain. +// refineBoundaryCells false; + +writeMesh false; +useHexTopology true; diff --git a/perpendicular-flap/fluid-openfoam/system/topoSetDict b/perpendicular-flap/fluid-openfoam/system/topoSetDict new file mode 100644 index 000000000..6937e88ee --- /dev/null +++ b/perpendicular-flap/fluid-openfoam/system/topoSetDict @@ -0,0 +1,22 @@ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object topoSetDict; +} + +actions +( + { + name refinementZoneVer; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (-0.5 0 0) (0.5 4 1); + } + } +); \ No newline at end of file diff --git a/perpendicular-flap/solid-calculix/flap.inp b/perpendicular-flap/solid-calculix/flap.inp index 4eda56c96..db216780c 100644 --- a/perpendicular-flap/solid-calculix/flap.inp +++ b/perpendicular-flap/solid-calculix/flap.inp @@ -3,7 +3,7 @@ *INCLUDE, INPUT=interface_beam.nam *MATERIAL, Name=EL *ELASTIC - 4000000, 0.3 + 200000000, 0.3 *DENSITY 3000 *SOLID SECTION, Elset=Eall, Material=EL