TUT: interTrack tutorials in incompressible pimpleFoam

This commit is contained in:
Zeljko Tukovic
2019-12-03 16:58:33 +01:00
committed by Andrew Heather
parent 79588b9b53
commit e5ede7e8c5
60 changed files with 2803 additions and 0 deletions

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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
#------------------------------------------------------------------------------

View File

@ -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)
#------------------------------------------------------------------------------

View File

@ -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);
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************** //

View File

@ -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);
// ************************************************************************* //

View File

@ -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;
// ************************************************************************* //

View File

@ -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;
// ************************************************************************* //

View File

@ -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
(
);
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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 );
}
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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
{
}
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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
#------------------------------------------------------------------------------

View File

@ -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)
#------------------------------------------------------------------------------

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************** //

View File

@ -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);
// ************************************************************************* //

View File

@ -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;
// ************************************************************************* //

View File

@ -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;
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
makePerturbation.C
EXE = $(FOAM_USER_APPBIN)/makePerturbation

View File

@ -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

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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
(
);

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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 );
}
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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
#------------------------------------------------------------------------------

View File

@ -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)
#------------------------------------------------------------------------------

View File

@ -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);
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************** //

View File

@ -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);
// ************************************************************************* //

View File

@ -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;
// ************************************************************************* //

View File

@ -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;
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
makeWave.C
EXE = $(FOAM_USER_APPBIN)/makeWave

View File

@ -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

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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
(
);
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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 );
}
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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
{
}
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //