diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/0/U b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/0/U new file mode 100644 index 0000000000000000000000000000000000000000..e3da1731d6ba9d1ea84c8e8a8022c685c2d8915b --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/0/U @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + top + { + type freeSurfaceVelocity; + value uniform (0 0 0); + } + + bottom + { + type slip; + } + + left + { + type slip; + } + + right + { + type slip; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/0/contactAngle b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/0/contactAngle new file mode 100644 index 0000000000000000000000000000000000000000..a40c651e3d601aec63d933c7256483dcf69dea19 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/0/contactAngle @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class areaScalarField; + location "0"; + object contactAngle; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + left + { + type calculated; + value uniform 70; + } + right + { + type calculated; + value uniform 70; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/0/p b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/0/p new file mode 100644 index 0000000000000000000000000000000000000000..3a0affcebf5df4f5565d5679042b24660e3885dd --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/0/p @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + top + { + type freeSurfacePressure; + pa uniform 0; + } + bottom + { + type zeroGradient; + } + left + { + type zeroGradient; + } + right + { + type zeroGradient; + } + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/0/pointMotionU b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/0/pointMotionU new file mode 100644 index 0000000000000000000000000000000000000000..4180f52668ff78f878a3607ee108d3157e9153c7 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/0/pointMotionU @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class pointVectorField; + location "0"; + object pointMotionU; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + top + { + type fixedValue; + value uniform (0 0 0); + } + bottom + { + type fixedValue; + value uniform (0 0 0); + } + left + { + type slip; + } + right + { + type slip; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/Allclean b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..a4d07e85f899520518644a289955270526b6fd86 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/Allclean @@ -0,0 +1,14 @@ +#!/bin/sh +cd ${0%/*} || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase + +#cleanTimeDirectories + +cleanFaMesh + +rm -r history + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/Allrun b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..d9f14c4ae34fdc1fa200ae1548ed814d7fc0986b --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/Allrun @@ -0,0 +1,11 @@ +#!/bin/sh +cd ${0%/*} || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +runApplication blockMesh +runApplication makeFaMesh + +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/dynamicMeshDict b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/dynamicMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..f23267675e027442e3f718161f0df8247343aea8 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/dynamicMeshDict @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh interfaceTrackingFvMesh; + +motionSolverLibs (fvMotionSolvers); + +motionSolver velocityLaplacian; + +diffusivity uniform; //onTimeChange inverseDistance 1(top); + + +// Free surface data + +fsPatchName top; + +fixedFreeSurfacePatches ( ); + +pointNormalsCorrectionPatches (); +// pointNormalsCorrectionPatches ( left right ); + +normalMotionDir false; + +motionDir (0 1 0); + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/faMesh/faMeshDefinition b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/faMesh/faMeshDefinition new file mode 100644 index 0000000000000000000000000000000000000000..3f691b9297e5242eeb11efa9fa5031c66b8d9fcf --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/faMesh/faMeshDefinition @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object faMeshDefinition; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +polyMeshPatches ( top ); + +boundary +{ + left + { + type patch; + ownerPolyPatch top; + neighbourPolyPatch left; + } + right + { + type patch; + ownerPolyPatch top; + neighbourPolyPatch right; + } + frontAndBack + { + type patch; + ownerPolyPatch top; + neighbourPolyPatch frontAndBack; + } +} + + +// ************************************************************************** // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/g b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..efb3fd1b6f28f985623b58e81734af42de29bdbe --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/g @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; + +value (0 0 0); + +// value (0 -1 0); + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/transportProperties b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..1847fed16b14afcd32009e88fefe13c3ce131592 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/transportProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu [0 2 -1 0 0 0 0] 1e-5; + +rho rho [1 -3 0 0 0 0 0] 1000; +sigma sigma [1 0 -2 0 0 0 0] 0.15; + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/turbulenceProperties b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..e35639d9fc92bd8d62ed792ef33fab2811f2a1ed --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..d11dfcd2d594291fdc4c0d65a532edd1a46893e2 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/blockMeshDict @@ -0,0 +1,89 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 0.01; + +vertices +( + (0 0 0) + (1 0 0) + (1 1 0) + (0 1 0) + (0 0 0.1) + (1 0 0.1) + (1 1 0.1) + (0 1 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (40 40 1) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + top + { + type patch; + faces + ( + (3 7 6 2) + ); + } + bottom + { + type wall; + faces + ( + (1 5 4 0) + ); + } + left + { + type wall; + faces + ( + (0 4 7 3) + ); + } + right + { + type wall; + faces + ( + (2 6 5 1) + ); + } + frontAndBack + { + type empty; + faces + ( + (0 3 2 1) + (4 5 6 7) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/controlDict b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..f2582c9e401b31fcf3d617a890edd7d5c30299d8 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/controlDict @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application pimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 0.2; + +deltaT 0.0001; + +writeControl timeStep; + +writeInterval 100; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +functions +{ + pointHistory + { + type pointHistory; + refHistoryPoint (0 0.01 0); + fileName leftPoint.txt; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/decomposeParDict b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..680a2ef498e9dec056c7a56818b4824ec2b719b1 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/decomposeParDict @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 2; + +method simple; + +coeffs +{ + n ( 2 1 1 ); +} + +metisCoeffs +{ + processorWeights ( 1 1 1 1 ); +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/faSchemes b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/faSchemes new file mode 100644 index 0000000000000000000000000000000000000000..8c1436d5e6b5bd0f9bdf4a91be36976627bd8b24 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/faSchemes @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object faSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default none; +} + +gradSchemes +{ + default none; + grad(Us) Gauss linear; +} + +divSchemes +{ + default none; + div(Us) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(Ds,Cs) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/faSolution b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/faSolution new file mode 100644 index 0000000000000000000000000000000000000000..cd64ced9120e06627ad6ab00fc06d3cd9006c7ab --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/faSolution @@ -0,0 +1,26 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object faSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{} + +relaxationFactors +{ +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/fvSchemes b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..2b36d2e476e9443ec85368aa2fde3b143c1a4aa4 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/fvSchemes @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default backward; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss linear; + div((nuEff*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/fvSolution b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..a703bd243b95f67d8372428902786f6b2f9c0742 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contactAngleCavity/system/fvSolution @@ -0,0 +1,91 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 1e-8; + relTol 0; + smoother GaussSeidel; + cacheAgglomeration no; + } + + pFinal + { + $p; + tolerance 1e-8; + relTol 0; + } + + "pcorr.*" + { + $p + tolerance 0.02; + relTol 0; + } + + U + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-9; + relTol 0; + } + + UFinal + { + $U; + tolerance 1e-9; + relTol 0; + } + + "cellMotionU|cellMotionUFinal" + { + solver PCG; + preconditioner DIC; + tolerance 1e-08; + relTol 0; + } +} + +PIMPLE +{ + correctPhi no; + nOuterCorrectors 12; + nCorrectors 3; + nNonOrthogonalCorrectors 0; + + pRefCell 0; + pRefValue 0; + + moveMeshOuterCorrectors true; + + consistent true; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/C b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/C new file mode 100644 index 0000000000000000000000000000000000000000..2cadac84c9d7e002ac9b222a626d98cb7be338d1 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/C @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object C; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -3 0 0 1 0 0]; + +internalField uniform 0; + +referenceLevel 0; + +boundaryField +{ + freeSurface + { + type fixedGradient; + gradient uniform 0; + } + frontAndBack + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/Cs b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/Cs new file mode 100644 index 0000000000000000000000000000000000000000..ff8bd28f768f78810188bfcf689dd6df9441a0e7 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/Cs @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class areaScalarField; + location "0"; + object Cs; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -2 0 0 1 0 0]; + +internalField uniform 0; + +referenceLevel 0; + +boundaryField +{ + fontAndBack + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/U b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/U new file mode 100644 index 0000000000000000000000000000000000000000..5f739322a11684d456afd28db7c6a5bb902a2a48 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/U @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + freeSurface + { + type freeSurfaceVelocity; + value uniform (0 0 0); + } + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/p b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/p new file mode 100644 index 0000000000000000000000000000000000000000..3c5ee12103b5db221c596faeee09eee508d4ad1b --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/p @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + freeSurface + { + type freeSurfacePressure; + pa uniform 0; + } + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/pointMotionU b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/pointMotionU new file mode 100644 index 0000000000000000000000000000000000000000..834b57c03c9852844282fdf22e73bdd1558258b6 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/0/pointMotionU @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class pointVectorField; + location "0"; + object pointMotionU; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + freeSurface + { + type fixedValue; + value uniform (0 0 0); + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/Allclean b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..7a400f64412ea1291ce52af6fbe8173b6b254e6e --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/Allclean @@ -0,0 +1,11 @@ +#!/bin/sh +cd ${0%/*} || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase +cleanFaMesh +(cd makePerturbation && wclean) +rm -r history + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/Allrun b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..5c6a4d2b9bf9826f1b7378d76ec1457e6e85e799 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/Allrun @@ -0,0 +1,17 @@ +#!/bin/sh +cd ${0%/*} || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +m4 < ./system/blockMeshDict.m4 > ./system/blockMeshDict + +runApplication blockMesh +runApplication makeFaMesh + +(cd makePerturbation && wmake) + +runApplication makePerturbation + +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/dynamicMeshDict b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/dynamicMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..3dea5406d8846f7cd4170898ac1624af1432b6b0 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/dynamicMeshDict @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh interfaceTrackingFvMesh; + +motionSolver velocityLaplacian; + +diffusivity uniform; + +// Free surface data + +fsPatchName freeSurface; + +fixedFreeSurfacePatches (); + +pointNormalsCorrectionPatches (); + +normalMotionDir true; + +motionDir (0 1 0); + +pureFreeSurface false; + +surfactantProperties +{ + soluble true; + + bulkConc bulkConc [ 0 -3 0 0 1 0 0 ] 1.0e-2; + + saturatedConc saturatedSurfConc [ 0 -2 0 0 1 0 0 ] 5.0e-6; + + adsorptionCoeff adsorptionCoeff [ 0 3 -1 0 -1 0 0 ] 400.0; + + desorptionCoeff desorptionCoeff [ 0 -3 0 0 1 0 0 ] 0.3; + + bulkDiffusion bulkDiffusion [ 0 2 -1 0 0 0 0 ] 5.0e-6; + + diffusion diffusion [ 0 2 -1 0 0 0 0 ] 5.0e-6; + + temperature temperature [ 0 0 0 1 0 0 0 ] 293.0; +} + + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/faMesh/faMeshDefinition b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/faMesh/faMeshDefinition new file mode 100644 index 0000000000000000000000000000000000000000..66c7b987e11d11260b8f0d8362260ad0f6d4fd10 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/faMesh/faMeshDefinition @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object faMeshDefinition; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +polyMeshPatches ( freeSurface ); + +boundary +{ + frontAndBack + { + type empty; + ownerPolyPatch freeSurface; + neighbourPolyPatch frontAndBack; + } +} + + +// ************************************************************************** // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/g b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..2669d0826db81c35a30f87a25d8838427a610daf --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; + +value (0 0 0); + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/transportProperties b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..9a5c8c2cde98f0bda48d19dd09290fc25c0c631a --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/transportProperties @@ -0,0 +1,26 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu [0 2 -1 0 0 0 0] 1e-6; + +rho [1 -3 0 0 0 0 0] 1000; + +sigma [1 0 -2 0 0 0 0] 0.073; + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/turbulenceProperties b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..e35639d9fc92bd8d62ed792ef33fab2811f2a1ed --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/makePerturbation/Make/files b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/makePerturbation/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..f7aadca4d92997a34765ff54df30393dcf883e35 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/makePerturbation/Make/files @@ -0,0 +1,3 @@ +makePerturbation.C + +EXE = $(FOAM_USER_APPBIN)/makePerturbation diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/makePerturbation/Make/options b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/makePerturbation/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..6cecabcd7901fc808b848983ead431b0b6f9ec29 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/makePerturbation/Make/options @@ -0,0 +1,15 @@ +EXE_INC = \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/fvMotionSolver/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/interfaceTrackingFvMesh/lnInclude \ + +EXE_LIBS = \ + -ldynamicFvMesh \ + -lfvMotionSolvers \ + -lmeshTools \ + -ldynamicMesh \ + -linterfaceTrackingFvMesh diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/makePerturbation/makePerturbation.C b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/makePerturbation/makePerturbation.C new file mode 100644 index 0000000000000000000000000000000000000000..af628bfa7a376b7d5202e18d325e533d4ff2f168 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/makePerturbation/makePerturbation.C @@ -0,0 +1,150 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2019 Zeljko Tukovic, FSB Zagreb. +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Application + makePerturbation + +Group + grpMeshManipulationUtilities + +Description + Make droplet perturbation. + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "Time.H" +#include "dynamicFvMesh.H" +#include "dynamicMotionSolverFvMesh.H" +#include "velocityLaplacianFvMotionSolver.H" +#include "polyPatchID.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + argList::addNote + ( + "Mesh motion and topological mesh changes utility" + ); + + #include "addRegionOption.H" + + #include "setRootCase.H" + #include "createTime.H" + #include "createDynamicFvMesh.H" + + dynamicMotionSolverFvMesh& dynMsh = + refCast<dynamicMotionSolverFvMesh>(mesh); + + motionSolver& motion = + const_cast<motionSolver&>(dynMsh.motion()); + + velocityLaplacianFvMotionSolver& vlMotion = + refCast<velocityLaplacianFvMotionSolver> + ( + motion + ); + + pointVectorField& pointMotionU = vlMotion.pointMotionU(); + + // Set motion boundary condition at free-surface patch + + word fsPatchName("freeSurface"); + polyPatchID fsPatch(fsPatchName, mesh.boundaryMesh()); + if (!fsPatch.active()) + { + FatalError + << "Patch name " << fsPatchName << " not found." + << abort(FatalError); + } + label fsPatchIndex = fsPatch.index(); + + const vectorField& fsPatchPoints = + mesh.boundaryMesh()[fsPatchIndex].localPoints(); + + vectorField fsPatchU(fsPatchPoints.size(), vector::zero); + + // Perturbation amplitude + scalar epsilon = 0.02; + + // Oscilation mode + label n = 4; + + forAll(fsPatchPoints, pointI) + { + const scalar x = fsPatchPoints[pointI].x(); + const scalar y = fsPatchPoints[pointI].y(); + + const scalar theta = ::atan2(y, x); + + scalar scale = (1.0 + epsilon*::cos(n*theta)); + + vector r0(x, y, 0); + + fsPatchU[pointI] = (scale - 1.0)*r0/runTime.deltaT().value(); + } + + fixedValuePointPatchVectorField& fsPatchPointMeshU = + refCast<fixedValuePointPatchVectorField> + ( + const_cast<pointPatchVectorField&> + ( + pointMotionU.boundaryField()[fsPatchIndex] + ) + ); + + fsPatchPointMeshU == fsPatchU; + + fileName meshDir = polyMesh::meshSubDir; + + pointIOField points + ( + IOobject + ( + "points", + runTime.findInstance(meshDir, "points"), + meshDir, + runTime, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ) + ); + + points = vlMotion.newPoints(); + + Info<< "Writing points into directory " << points.path() << nl << endl; + points.write(); + + Info<< "\nEnd\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/blockMeshDict.m4 b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/blockMeshDict.m4 new file mode 100644 index 0000000000000000000000000000000000000000..6ad95399fc8d2a49738245d02e39ebe2e02a69e8 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/blockMeshDict.m4 @@ -0,0 +1,269 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + `format' ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// General macros to create cylinder mesh + +changecom(//)changequote([,]) +define(calc, [esyscmd(perl -e 'use Math::Trig; print ($1)')]) +define(VCOUNT, 0) +define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) + +define(hex2D, hex ($1b $2b $3b $4b $1t $2t $3t $4t)) +define(btQuad, ($1b $2b $2t $1t)) +define(topQuad, ($1t $4t $3t $2t)) +define(bottomQuad, ($1b $2b $3b $4b)) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 0.001; + +// Inner square side half +define(s, 0.5) +//define(s, 0.35) + +// Inner square side curvature +define(sc, 0.6) +//define(sc, 0.4) + +// cylinder radius +define(r, 1) +//define(r, 0.7) + +// Height of cylinder +define(z, 0.1) +//define(z, 20.0) + +// Base z +define(Zb, 0) + +// Outlet z +define(Zt, calc(Zb + z)) + +// Number of cells at inner square +define(Ns, 20) + +// Number of cells between inner square and circle +define(Ni, 10) + +// Number of cells in the cylinder height +define(Nz, 1) +//define(Nz, 100) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +define(vert, (x$1$2 y$1$2 $3)) +define(evert, (ex$1$2 ey$1$2 $3)) + +// 45 degree points angle +define(a0, -45) +define(a1, -135) +define(a2, 135) +define(a3, 45) + +// Half of 45 degree points angle +define(ea0, 0) +define(ea1, -90) +define(ea2, 180) +define(ea3, 90) + +define(ca0, calc(cos((pi/180)*a0))) +define(ca1, calc(cos((pi/180)*a1))) +define(ca2, calc(cos((pi/180)*a2))) +define(ca3, calc(cos((pi/180)*a3))) + +define(sa0, calc(sin((pi/180)*a0))) +define(sa1, calc(sin((pi/180)*a1))) +define(sa2, calc(sin((pi/180)*a2))) +define(sa3, calc(sin((pi/180)*a3))) + +define(cea0, calc(cos((pi/180)*ea0))) +define(cea1, calc(cos((pi/180)*ea1))) +define(cea2, calc(cos((pi/180)*ea2))) +define(cea3, calc(cos((pi/180)*ea3))) + +define(sea0, calc(sin((pi/180)*ea0))) +define(sea1, calc(sin((pi/180)*ea1))) +define(sea2, calc(sin((pi/180)*ea2))) +define(sea3, calc(sin((pi/180)*ea3))) + +// Inner square x and y position + +// x +define(x00, s) +define(x01, calc(-1.0*s)) +define(x02, calc(-1.0*s)) +define(x03, s) + +// y +define(y00, calc(-1.0*s)) +define(y01, calc(-1.0*s)) +define(y02, s) +define(y03, s) + +// Circle x and y positions + +// x +define(x10, calc(r*ca0)) +define(x11, calc(r*ca1)) +define(x12, calc(r*ca2)) +define(x13, calc(r*ca3)) + +// y +define(y10, calc(r*sa0)) +define(y11, calc(r*sa1)) +define(y12, calc(r*sa2)) +define(y13, calc(r*sa3)) + +// Inner square x and y position middle curvatures + +// x +define(ex00, sc) +define(ex01, 0) +define(ex02, calc(-1.0*sc)) +define(ex03, 0) + +// y +define(ey00, 0) +define(ey01, calc(-1.0*sc)) +define(ey02, 0) +define(ey03, sc) + +// Circle x and y positions middle curvatures + +// x +define(ex10, calc(r*cea0)) +define(ex11, calc(r*cea1)) +define(ex12, calc(r*cea2)) +define(ex13, calc(r*cea3)) + +// y +define(ey10, calc(r*sea0)) +define(ey11, calc(r*sea1)) +define(ey12, calc(r*sea2)) +define(ey13, calc(r*sea3)) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +vertices +( + vert(0, 0, Zb) vlabel(s0b) + vert(0, 1, Zb) vlabel(s1b) + vert(0, 2, Zb) vlabel(s2b) + vert(0, 3, Zb) vlabel(s3b) + + vert(1, 0, Zb) vlabel(r0b) + vert(1, 1, Zb) vlabel(r1b) + vert(1, 2, Zb) vlabel(r2b) + vert(1, 3, Zb) vlabel(r3b) + + vert(0, 0, Zt) vlabel(s0t) + vert(0, 1, Zt) vlabel(s1t) + vert(0, 2, Zt) vlabel(s2t) + vert(0, 3, Zt) vlabel(s3t) + + vert(1, 0, Zt) vlabel(r0t) + vert(1, 1, Zt) vlabel(r1t) + vert(1, 2, Zt) vlabel(r2t) + vert(1, 3, Zt) vlabel(r3t) +); + +blocks +( + //block0 + hex2D(s1, s0, s3, s2) + square + (Ns Ns Nz) + simpleGrading (1 1 1) + + //block1 + hex2D(s0, r0, r3, s3) + innerCircle + (Ni Ns Nz) + simpleGrading (1 1 1) + + //block2 + hex2D(s3, r3, r2, s2) + innerCircle + (Ni Ns Nz) + simpleGrading (1 1 1) + + //block3 + hex2D(s2, r2, r1, s1) + innerCircle + (Ni Ns Nz) + simpleGrading (1 1 1) + + //block4 + hex2D(s1, r1, r0, s0) + innerCircle + (Ni Ns Nz) + simpleGrading (1 1 1) +); + +edges +( + //Circle edges + arc r3b r0b evert(1, 0, Zb) + arc r0b r1b evert(1, 1, Zb) + arc r1b r2b evert(1, 2, Zb) + arc r2b r3b evert(1, 3, Zb) + + //Circle edges + arc r3t r0t evert(1, 0, Zt) + arc r0t r1t evert(1, 1, Zt) + arc r1t r2t evert(1, 2, Zt) + arc r2t r3t evert(1, 3, Zt) + + arc s3b s0b evert(0, 0, Zb) + arc s0b s1b evert(0, 1, Zb) + arc s1b s2b evert(0, 2, Zb) + arc s2b s3b evert(0, 3, Zb) + + arc s3t s0t evert(0, 0, Zt) + arc s0t s1t evert(0, 1, Zt) + arc s1t s2t evert(0, 2, Zt) + arc s2t s3t evert(0, 3, Zt) + +); + +patches +( + patch freeSurface + ( + btQuad(r0, r3) + btQuad(r1, r0) + btQuad(r2, r1) + btQuad(r3, r2) + ) + + empty frontAndBack + ( + bottomQuad(s3, s0, s1, s2) + bottomQuad(s3, r3, r0, s0) + bottomQuad(s2, r2, r3, s3) + bottomQuad(s1, r1, r2, s2) + bottomQuad(s0, r0, r1, s1) + + topQuad(s3, s0, s1, s2) + topQuad(s3, r3, r0, s0) + topQuad(s2, r2, r3, s3) + topQuad(s1, r1, r2, s2) + topQuad(s0, r0, r1, s1) + ) +); + +mergePatchPairs +( +); diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/controlDict b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..4ab07a672a2636bb8c7fd3780ace654d532bf7e4 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/controlDict @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application pimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 0.025; + +deltaT 0.00005; + +writeControl timeStep; + +writeInterval 20; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +functions +{ + pointHistory + { + type pointHistory; + refHistoryPoint (0.00102 0 0); + fileName rightPoint.txt; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/decomposeParDict b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..680a2ef498e9dec056c7a56818b4824ec2b719b1 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/decomposeParDict @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 2; + +method simple; + +coeffs +{ + n ( 2 1 1 ); +} + +metisCoeffs +{ + processorWeights ( 1 1 1 1 ); +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/faSchemes b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/faSchemes new file mode 100644 index 0000000000000000000000000000000000000000..ff17f2a7bd398f9bf15b33a9146202ef3de90e00 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/faSchemes @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object faSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default leastSquares; + // grad(p) Gauss linear; +} + +divSchemes +{ + default none; + div(Us) Gauss linear; + div(phis,Cs) Gauss upwind; +} + +laplacianSchemes +{ + default none; + laplacian(diffusion,Cs) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/faSolution b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/faSolution new file mode 100644 index 0000000000000000000000000000000000000000..e3ddb57dd0f03042b207ccf4c5224e3c97352e09 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/faSolution @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object faSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + Cs + { + solver PBiCG; + preconditioner DILU; + minIter 0; + maxIter 2000; + tolerance 1e-8; + relTol 0; + } +} + +PISO +{ + nCorrectors 2; + nNonOrthogonalCorrectors 0; +} + +SIMPLE +{ + nTimeCorrectors 6; + nNonOrthogonalCorrectors 1; +} + +relaxationFactors +{ + p 0.7; + U 0.7; + k 0.7; + epsilon 0.7; + R 0.7; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/fvSchemes b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..67f03e3924b7799a7fb478f0b234d518a5dcba3f --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/fvSchemes @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default backward; +} + +gradSchemes +{ + default leastSquares; +} + +divSchemes +{ + default none; + div(phi,U) Gauss skewCorrected linear; + div((nuEff*dev2(T(grad(U))))) Gauss linear; + div(phi,C) Gauss skewCorrected linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default skewCorrected linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/fvSolution b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..f7eda2944a024da5affaa41b16dd004d04ae8b91 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/contaminatedDroplet2D/system/fvSolution @@ -0,0 +1,99 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 1e-8; + relTol 0; + smoother GaussSeidel; + cacheAgglomeration no; + } + + pFinal + { + $p; + tolerance 1e-8; + relTol 0; + } + + "pcorr.*" + { + $p + tolerance 0.02; + relTol 0; + } + + U + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-9; + relTol 0; + } + + UFinal + { + $U; + tolerance 1e-9; + relTol 0; + } + + "cellMotionU|cellMotionUFinal" + { + solver PCG; + preconditioner DIC; + tolerance 1e-08; + relTol 0; + } + + "C|CFinal" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-9; + relTol 0; + } +} + +PIMPLE +{ + correctPhi no; + nOuterCorrectors 12; + nCorrectors 3; + nNonOrthogonalCorrectors 0; + + pRefCell 0; + pRefValue 0; + + moveMeshOuterCorrectors true; + + consistent true; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/0/U b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/0/U new file mode 100644 index 0000000000000000000000000000000000000000..e3da1731d6ba9d1ea84c8e8a8022c685c2d8915b --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/0/U @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + top + { + type freeSurfaceVelocity; + value uniform (0 0 0); + } + + bottom + { + type slip; + } + + left + { + type slip; + } + + right + { + type slip; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/0/p b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/0/p new file mode 100644 index 0000000000000000000000000000000000000000..863042e15e7ac9c371a3de00f761818fd6fefc85 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/0/p @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + top + { + type freeSurfacePressure; + pa uniform 0; + } + bottom + { + type zeroGradient; + } + left + { + type zeroGradient; + } + right + { + type zeroGradient; + } + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/0/pointMotionU b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/0/pointMotionU new file mode 100644 index 0000000000000000000000000000000000000000..4180f52668ff78f878a3607ee108d3157e9153c7 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/0/pointMotionU @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class pointVectorField; + location "0"; + object pointMotionU; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + top + { + type fixedValue; + value uniform (0 0 0); + } + bottom + { + type fixedValue; + value uniform (0 0 0); + } + left + { + type slip; + } + right + { + type slip; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/Allclean b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..ef319aa5cd5fea92bb9ef1eb426caec46fe9e6d2 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/Allclean @@ -0,0 +1,16 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory +. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions + +cleanCase + +#cleanTimeDirectories + +cleanFaMesh + +(cd makeWave && wclean) + +rm -r history + + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/Allrun b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..9b248e435ca538e777f75b9dbb1ecf0cfd9786ec --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/Allrun @@ -0,0 +1,13 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory +. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions + +runApplication blockMesh +runApplication makeFaMesh + +(cd makeWave && wmake) + +runApplication makeWave +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/dynamicMeshDict b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/dynamicMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..502f20ab5318872271011f3902084e230fb394de --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/dynamicMeshDict @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh interfaceTrackingFvMesh; + +motionSolverLibs (fvMotionSolvers); + +motionSolver velocityLaplacian; + +diffusivity uniform; //onTimeChange inverseDistance 1(top); + + +// Free surface data + +fsPatchName top; + +fixedFreeSurfacePatches (); + +pointNormalsCorrectionPatches ( left right ); + +normalMotionDir false; + +motionDir (0 1 0); + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/faMesh/faMeshDefinition b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/faMesh/faMeshDefinition new file mode 100644 index 0000000000000000000000000000000000000000..870e0cd1b1f74b6fb7f2363eafca4d6f75e70871 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/faMesh/faMeshDefinition @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object faMeshDefinition; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +polyMeshPatches ( top ); + +boundary +{ + left + { + type patch; + ownerPolyPatch top; + neighbourPolyPatch left; + } + right + { + type patch; + ownerPolyPatch top; + neighbourPolyPatch right; + } + frontAndBack + { + type empty; + ownerPolyPatch top; + neighbourPolyPatch frontAndBack; + } +} + + +// ************************************************************************** // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/g b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..de1587abdcf52a6560a71b344f8c194e96e99d1b --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/g @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; + +value (0 -1 0); + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/transportProperties b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..be1bb788f873dab7350d613c334bb47b02c75b2f --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/transportProperties @@ -0,0 +1,26 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu [0 2 -1 0 0 0 0] 0; //0.01; + +rho rho [1 -3 0 0 0 0 0] 1; + +sigma sigma [1 0 -2 0 0 0 0] 0.1; + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/turbulenceProperties b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..e35639d9fc92bd8d62ed792ef33fab2811f2a1ed --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/makeWave/Make/files b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/makeWave/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..48f3103671caa294ff41047a1c7fcda6501cfebb --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/makeWave/Make/files @@ -0,0 +1,3 @@ +makeWave.C + +EXE = $(FOAM_USER_APPBIN)/makeWave diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/makeWave/Make/options b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/makeWave/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..6cecabcd7901fc808b848983ead431b0b6f9ec29 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/makeWave/Make/options @@ -0,0 +1,15 @@ +EXE_INC = \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/fvMotionSolver/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/interfaceTrackingFvMesh/lnInclude \ + +EXE_LIBS = \ + -ldynamicFvMesh \ + -lfvMotionSolvers \ + -lmeshTools \ + -ldynamicMesh \ + -linterfaceTrackingFvMesh diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/makeWave/makeWave.C b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/makeWave/makeWave.C new file mode 100644 index 0000000000000000000000000000000000000000..2cd9c3918562f6ba850a203c610f098b2ff7996e --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/makeWave/makeWave.C @@ -0,0 +1,146 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2019 Zeljko Tukovic, FSB Zagreb. +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Application + makeWave + +Group + grpMeshManipulationUtilities + +Description + Make wave at top boundary patch. + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "Time.H" +#include "dynamicFvMesh.H" +#include "dynamicMotionSolverFvMesh.H" +#include "velocityLaplacianFvMotionSolver.H" +#include "polyPatchID.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + argList::addNote + ( + "Mesh motion and topological mesh changes utility" + ); + + #include "addRegionOption.H" + + #include "setRootCase.H" + #include "createTime.H" + #include "createDynamicFvMesh.H" + + dynamicMotionSolverFvMesh& dynMsh = + refCast<dynamicMotionSolverFvMesh>(mesh); + + motionSolver& motion = + const_cast<motionSolver&>(dynMsh.motion()); + + velocityLaplacianFvMotionSolver& vlMotion = + refCast<velocityLaplacianFvMotionSolver> + ( + motion + ); + + pointVectorField& pointMotionU = vlMotion.pointMotionU(); + + + // Set motion boundary condition at top patch + + word topPatchName("top"); + polyPatchID topPatch(topPatchName, mesh.boundaryMesh()); + if (!topPatch.active()) + { + FatalError + << "Patch name " << topPatchName << " not found." + << abort(FatalError); + } + label topPatchIndex = topPatch.index(); + + const vectorField& topPatchPoints = + mesh.boundaryMesh()[topPatchIndex].localPoints(); + + vectorField topPatchU(topPatchPoints.size(), Zero); + + scalar L = 1.0; + scalar a0 = 0.01; + + forAll(topPatchPoints, pointI) + { + const scalar x = topPatchPoints[pointI].x(); + topPatchU[pointI] = + vector + ( + 0, + a0*::cos(M_PI*x/L)/runTime.deltaT().value(), + 0 + ); + } + + fixedValuePointPatchVectorField& topPatchPointMeshU = + refCast<fixedValuePointPatchVectorField> + ( + const_cast<pointPatchVectorField&> + ( + pointMotionU.boundaryField()[topPatchIndex] + ) + ); + + topPatchPointMeshU == topPatchU; + + fileName meshDir = polyMesh::meshSubDir; + + pointIOField points + ( + IOobject + ( + "points", + runTime.findInstance(meshDir, "points"), + meshDir, + runTime, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ) + ); + + points = vlMotion.newPoints(); + + Info<< "Writing points into directory " << points.path() << nl << endl; + points.write(); + + Info<< "\nEnd\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..f137291a3e18d470cac9942d9823e7bfcd3b92d7 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/blockMeshDict @@ -0,0 +1,89 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 1; + +vertices +( + (0 0 0) + (1 0 0) + (1 1 0) + (0 1 0) + (0 0 0.1) + (1 0 0.1) + (1 1 0.1) + (0 1 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (40 40 1) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + top + { + type wall; + faces + ( + (3 7 6 2) + ); + } + bottom + { + type wall; + faces + ( + (1 5 4 0) + ); + } + left + { + type wall; + faces + ( + (0 4 7 3) + ); + } + right + { + type wall; + faces + ( + (2 6 5 1) + ); + } + frontAndBack + { + type empty; + faces + ( + (0 3 2 1) + (4 5 6 7) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/controlDict b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..042a6f99f5782684eb78dd13f5b716b33915dcbc --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/controlDict @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application pimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 20; + +deltaT 0.02; + +writeControl timeStep; + +writeInterval 20; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +functions +{ + pointHistory + { + type pointHistory; + refHistoryPoint (0 1.01 0); + fileName leftPoint.txt; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/decomposeParDict b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..8e34ee1400e35b40f2030ff6ad6a0a1db048294e --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/decomposeParDict @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 2; + +method simple; + +coeffs +{ + n ( 2 1 1 ); +} + +metisCoeffs +{ + processorWeights ( 1 1 1 1 ); +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/faSchemes b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/faSchemes new file mode 100644 index 0000000000000000000000000000000000000000..6bfc17b49754cababfebcb4b0715594378796a51 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/faSchemes @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object faSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default none; +} + +gradSchemes +{ + default none; + grad(Us) Gauss linear; +} + +divSchemes +{ + default none; + div(Us) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(Ds,Cs) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/faSolution b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/faSolution new file mode 100644 index 0000000000000000000000000000000000000000..99bb0c9f3ceeb33cc2508a7185a0b53ac699c696 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/faSolution @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object faSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ +} + + +relaxationFactors +{ +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/fvSchemes b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..56d749b3ac32a6c26f221a76c8dc8ed6f53a2155 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/fvSchemes @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default backward; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss linear; + div((nuEff*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/fvSolution b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..366758d0658cb1dfb5c16c1e937cc5a3c50314b5 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/laminar/sloshing2D/system/fvSolution @@ -0,0 +1,91 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 1e-8; + relTol 0; + smoother GaussSeidel; + cacheAgglomeration no; + } + + pFinal + { + $p; + tolerance 1e-8; + relTol 0; + } + + "pcorr.*" + { + $p + tolerance 0.02; + relTol 0; + } + + U + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-9; + relTol 0; + } + + UFinal + { + $U; + tolerance 1e-9; + relTol 0; + } + + "cellMotionU|cellMotionUFinal" + { + solver PCG; + preconditioner DIC; + tolerance 1e-08; + relTol 0; + } +} + +PIMPLE +{ + correctPhi no; + nOuterCorrectors 12; + nCorrectors 3; + nNonOrthogonalCorrectors 0; + + pRefCell 0; + pRefValue 0; + + moveMeshOuterCorrectors true; + + consistent true; +} + +relaxationFactors +{ + equations + { + "U.*" 1; + } +} + + +// ************************************************************************* //