diff --git a/tutorials/fluid/aerofoilNACA0012Steady/0/U b/tutorials/fluid/aerofoilNACA0012Steady/0/U index 9a787845a3..c313f13f5b 100644 --- a/tutorials/fluid/aerofoilNACA0012Steady/0/U +++ b/tutorials/fluid/aerofoilNACA0012Steady/0/U @@ -17,23 +17,11 @@ speed 250; angleOfAttack 0; // degs angle #calc "degToRad($angleOfAttack)"; -liftDir #codeStream -{ - codeInclude #{ #include "vector.H" #}; - code #{ os << vector(-::sin($angle), 0, ::cos($angle)); #}; -}; -dragDir #codeStream -{ - codeInclude #{ #include "vector.H" #}; - code #{ os << vector(::cos($angle), 0, ::sin($angle)); #}; -}; +liftDir #calc "vector(-::sin($angle), 0, ::cos($angle))"; +dragDir #calc "vector(::cos($angle), 0, ::sin($angle))"; -Uinlet #codeStream -{ - codeInclude #{ #include "vector.H" #}; - code #{ os << $speed*vector(::cos($angle), 0, ::sin($angle)); #}; -}; +Uinlet #calc "$speed*$dragDir"; dimensions [0 1 -1 0 0 0 0]; diff --git a/tutorials/incompressibleFluid/mixerVessel2D/system/createBafflesDict b/tutorials/incompressibleFluid/mixerVessel2D/system/createBafflesDict index 4fa5140bb1..bb2089c663 100644 --- a/tutorials/incompressibleFluid/mixerVessel2D/system/createBafflesDict +++ b/tutorials/incompressibleFluid/mixerVessel2D/system/createBafflesDict @@ -26,7 +26,7 @@ baffles surface searchableCylinder; point1 (0 0 -100); point2 (0 0 100); - radius $rotorRegion; + radius $rMid; owner { diff --git a/tutorials/incompressibleFluid/mixerVesselHorizontal2DParticles/system/createBafflesDict b/tutorials/incompressibleFluid/mixerVesselHorizontal2DParticles/system/createBafflesDict index 29a884518b..04895ee5d6 100644 --- a/tutorials/incompressibleFluid/mixerVesselHorizontal2DParticles/system/createBafflesDict +++ b/tutorials/incompressibleFluid/mixerVesselHorizontal2DParticles/system/createBafflesDict @@ -25,18 +25,18 @@ baffles surface searchableCylinder; point1 (0 0 -100); point2 (0 0 100); - radius $rotorRegion; + radius $rMid; owner { - name nonCouple1; - type patch; + name nonCouple1; + type patch; } neighbour { - name nonCouple2; - type patch; + name nonCouple2; + type patch; } } } diff --git a/tutorials/incompressibleFluid/rotor2DRotating/0/U b/tutorials/incompressibleFluid/rotor2D/0/U similarity index 90% rename from tutorials/incompressibleFluid/rotor2DRotating/0/U rename to tutorials/incompressibleFluid/rotor2D/0/U index af87abfa9a..480a7e68fd 100644 --- a/tutorials/incompressibleFluid/rotor2DRotating/0/U +++ b/tutorials/incompressibleFluid/rotor2D/0/U @@ -9,6 +9,7 @@ FoamFile { format ascii; class volVectorField; + location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -19,6 +20,8 @@ internalField uniform (1 0 0); boundaryField { + #includeEtc "caseDicts/setConstraintTypes" + rotor { type movingWallVelocity; @@ -30,16 +33,6 @@ boundaryField type freestreamVelocity; freestreamValue $internalField; } - - front - { - type empty; - } - - back - { - type empty; - } } // ************************************************************************* // diff --git a/tutorials/incompressibleFluid/rotor2DRotating/0/epsilon b/tutorials/incompressibleFluid/rotor2D/0/epsilon similarity index 90% rename from tutorials/incompressibleFluid/rotor2DRotating/0/epsilon rename to tutorials/incompressibleFluid/rotor2D/0/epsilon index b9bc700e63..a185626e90 100644 --- a/tutorials/incompressibleFluid/rotor2DRotating/0/epsilon +++ b/tutorials/incompressibleFluid/rotor2D/0/epsilon @@ -20,6 +20,8 @@ internalField uniform 3.75e-4; boundaryField { + #includeEtc "caseDicts/setConstraintTypes" + rotor { type epsilonWallFunction; @@ -31,16 +33,6 @@ boundaryField type inletOutlet; inletValue uniform 3.75e-4; } - - front - { - type empty; - } - - back - { - type empty; - } } diff --git a/tutorials/incompressibleFluid/rotor2DRotating/0/k b/tutorials/incompressibleFluid/rotor2D/0/k similarity index 90% rename from tutorials/incompressibleFluid/rotor2DRotating/0/k rename to tutorials/incompressibleFluid/rotor2D/0/k index e5b0a3ab7e..994e9d5a7a 100644 --- a/tutorials/incompressibleFluid/rotor2DRotating/0/k +++ b/tutorials/incompressibleFluid/rotor2D/0/k @@ -20,6 +20,8 @@ internalField uniform 3.75e-3; boundaryField { + #includeEtc "caseDicts/setConstraintTypes" + rotor { type kqRWallFunction; @@ -31,16 +33,6 @@ boundaryField type inletOutlet; inletValue uniform 3.75e-3; } - - front - { - type empty; - } - - back - { - type empty; - } } diff --git a/tutorials/incompressibleFluid/rotor2DRotating/0/nut b/tutorials/incompressibleFluid/rotor2D/0/nut similarity index 89% rename from tutorials/incompressibleFluid/rotor2DRotating/0/nut rename to tutorials/incompressibleFluid/rotor2D/0/nut index 63fc75f0c7..82a2a0f4ec 100644 --- a/tutorials/incompressibleFluid/rotor2DRotating/0/nut +++ b/tutorials/incompressibleFluid/rotor2D/0/nut @@ -20,6 +20,8 @@ internalField uniform 0; boundaryField { + #includeEtc "caseDicts/setConstraintTypes" + rotor { type nutkWallFunction; @@ -31,16 +33,6 @@ boundaryField type calculated; value uniform 0; } - - front - { - type empty; - } - - back - { - type empty; - } } diff --git a/tutorials/incompressibleFluid/rotor2DRotating/0/p b/tutorials/incompressibleFluid/rotor2D/0/p similarity index 89% rename from tutorials/incompressibleFluid/rotor2DRotating/0/p rename to tutorials/incompressibleFluid/rotor2D/0/p index 2de99b4fe2..8a453b60d0 100644 --- a/tutorials/incompressibleFluid/rotor2DRotating/0/p +++ b/tutorials/incompressibleFluid/rotor2D/0/p @@ -9,6 +9,7 @@ FoamFile { format ascii; class volScalarField; + location "0"; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -19,6 +20,8 @@ internalField uniform 0; boundaryField { + #includeEtc "caseDicts/setConstraintTypes" + rotor { type zeroGradient; @@ -29,16 +32,6 @@ boundaryField type freestreamPressure; freestreamValue $internalField; } - - front - { - type empty; - } - - back - { - type empty; - } } // ************************************************************************* // diff --git a/tutorials/incompressibleFluid/rotor2DRotating/constant/dynamicMeshDict b/tutorials/incompressibleFluid/rotor2D/constant/dynamicMeshDict similarity index 100% rename from tutorials/incompressibleFluid/rotor2DRotating/constant/dynamicMeshDict rename to tutorials/incompressibleFluid/rotor2D/constant/dynamicMeshDict diff --git a/tutorials/incompressibleFluid/rotor2DRotating/constant/momentumTransport b/tutorials/incompressibleFluid/rotor2D/constant/momentumTransport similarity index 100% rename from tutorials/incompressibleFluid/rotor2DRotating/constant/momentumTransport rename to tutorials/incompressibleFluid/rotor2D/constant/momentumTransport diff --git a/tutorials/incompressibleFluid/rotor2DRotating/constant/physicalProperties b/tutorials/incompressibleFluid/rotor2D/constant/physicalProperties similarity index 100% rename from tutorials/incompressibleFluid/rotor2DRotating/constant/physicalProperties rename to tutorials/incompressibleFluid/rotor2D/constant/physicalProperties diff --git a/tutorials/incompressibleFluid/rotor2D/system/blockMeshDict b/tutorials/incompressibleFluid/rotor2D/system/blockMeshDict new file mode 100644 index 0000000000..24a142e825 --- /dev/null +++ b/tutorials/incompressibleFluid/rotor2D/system/blockMeshDict @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +nBlades 4; + +rHub 0.005; +rTip 0.02; +rFreestream 0.1; + +halfDepth 0.005; + +nCellsHubTip 6; +nCellsTipFreestream 24; +nCellsBladeBlade 24; + +#include "$FOAM_TUTORIALS/resources/blockMesh/rotor2D" + +// ************************************************************************* // diff --git a/tutorials/incompressibleFluid/rotor2DRotating/system/controlDict b/tutorials/incompressibleFluid/rotor2D/system/controlDict similarity index 100% rename from tutorials/incompressibleFluid/rotor2DRotating/system/controlDict rename to tutorials/incompressibleFluid/rotor2D/system/controlDict diff --git a/tutorials/incompressibleFluid/rotor2DRotating/system/fvSchemes b/tutorials/incompressibleFluid/rotor2D/system/fvSchemes similarity index 100% rename from tutorials/incompressibleFluid/rotor2DRotating/system/fvSchemes rename to tutorials/incompressibleFluid/rotor2D/system/fvSchemes diff --git a/tutorials/incompressibleFluid/rotor2DRotating/system/fvSolution b/tutorials/incompressibleFluid/rotor2D/system/fvSolution similarity index 100% rename from tutorials/incompressibleFluid/rotor2DRotating/system/fvSolution rename to tutorials/incompressibleFluid/rotor2D/system/fvSolution diff --git a/tutorials/incompressibleFluid/rotor2DRotating/system/blockMeshDict b/tutorials/incompressibleFluid/rotor2DRotating/system/blockMeshDict deleted file mode 100644 index 9ae4f29584..0000000000 --- a/tutorials/incompressibleFluid/rotor2DRotating/system/blockMeshDict +++ /dev/null @@ -1,185 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Version: dev - \\/ M anipulation | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - format ascii; - class dictionary; - object blockMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -convertToMeters 1.0; - -hub 0.005; -rotorBlades 0.02; -freestream 0.1; -halfDepth 0.005; -angle 90; - -nRadialRotorCells 6; -nRadialOuterCells 24; -nCircCells 24; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -vertices #codeStream -{ - codeInclude - #{ - #include "pointField.H" - #include "transformField.H" - #}; - - code - #{ - const pointField initPoints - ({ - point(-$freestream, 0, -$halfDepth), - point(-$rotorBlades, 0, -$halfDepth), - point(-$hub, 0, -$halfDepth), - point(-$hub, 0, -$halfDepth), - }); - - pointField points; - - // Rotate points around z-axis and append - for (label i = 0; i < 4; i++) - { - points.append(transform(Rz(degToRad(i*$angle)), initPoints)); - } - - // Duplicate z points - points.append(points + vector(0, 0, 2*$halfDepth)); - - os << points; - #}; -}; - -rotorBlock all ($nCircCells $nRadialRotorCells 1) simpleGrading (1 1 1); -outerBlock all ($nCircCells $nRadialOuterCells 1) simpleGrading (1 1 1); - -blocks -( - hex (6 2 1 5 22 18 17 21) $rotorBlock - hex (10 7 5 9 26 23 21 25) $rotorBlock - hex (14 11 9 13 30 27 25 29) $rotorBlock - hex (3 15 13 1 19 31 29 17) $rotorBlock - - hex (5 1 0 4 21 17 16 20) $outerBlock - hex (9 5 4 8 25 21 20 24) $outerBlock - hex (13 9 8 12 29 25 24 28) $outerBlock - hex (1 13 12 0 17 29 28 16) $outerBlock -); - -circle $angle (0 0 1); - -edges -( - arc 2 6 $circle - arc 7 10 $circle - arc 11 14 $circle - arc 15 3 $circle - arc 18 22 $circle - arc 23 26 $circle - arc 27 30 $circle - arc 31 19 $circle - - arc 1 5 $circle - arc 5 9 $circle - arc 9 13 $circle - arc 13 1 $circle - arc 17 21 $circle - arc 21 25 $circle - arc 25 29 $circle - arc 29 17 $circle - - arc 0 4 $circle - arc 4 8 $circle - arc 8 12 $circle - arc 12 0 $circle - arc 16 20 $circle - arc 20 24 $circle - arc 24 28 $circle - arc 28 16 $circle - -); - -defaultPatch -{ - name walls; - type wall; -} - -boundary -( - rotor - { - type wall; - faces - ( - (2 18 22 6) - (7 23 26 10) - (11 27 30 14) - (15 31 19 3) - (1 17 18 2) - (17 1 3 19) - (5 21 22 6) - (21 5 7 23) - (26 10 9 25) - (11 27 25 9) - (30 14 13 29) - (29 13 15 31) - ); - } - - freestream - { - type patch; - faces - ( - (16 0 4 20) - (20 4 8 24) - (24 8 12 28) - (28 12 0 16) - ); - } - - front - { - type empty; - faces - ( - (17 21 22 18) - (21 25 26 23) - (25 29 30 27) - (29 17 19 31) - (16 20 21 17) - (20 24 25 21) - (25 24 28 29) - (29 28 16 17) - ); - } - - back - { - type empty; - faces - ( - (5 1 2 6) - (5 7 10 9) - (9 11 14 13) - (15 3 1 13) - (0 1 5 4) - (4 5 9 8) - (8 9 13 12) - (12 13 1 0) - ); - } -); - -// ************************************************************************* // diff --git a/tutorials/incompressibleFluid/rotor2DSRF/0/U b/tutorials/incompressibleFluid/rotor2DSRF/0/U index 0212e27517..29fd886a80 100644 --- a/tutorials/incompressibleFluid/rotor2DSRF/0/U +++ b/tutorials/incompressibleFluid/rotor2DSRF/0/U @@ -9,6 +9,7 @@ FoamFile { format ascii; class volVectorField; + location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -19,6 +20,8 @@ internalField uniform (1 0 0); boundaryField { + #includeEtc "caseDicts/setConstraintTypes" + rotor { type MRFnoSlip; @@ -30,16 +33,6 @@ boundaryField freestreamValue0 (1 0 0); freestreamValue $internalField; } - - front - { - type empty; - } - - back - { - type empty; - } } // ************************************************************************* // diff --git a/tutorials/incompressibleFluid/rotor2DSRF/0/epsilon b/tutorials/incompressibleFluid/rotor2DSRF/0/epsilon index b9bc700e63..a185626e90 100644 --- a/tutorials/incompressibleFluid/rotor2DSRF/0/epsilon +++ b/tutorials/incompressibleFluid/rotor2DSRF/0/epsilon @@ -20,6 +20,8 @@ internalField uniform 3.75e-4; boundaryField { + #includeEtc "caseDicts/setConstraintTypes" + rotor { type epsilonWallFunction; @@ -31,16 +33,6 @@ boundaryField type inletOutlet; inletValue uniform 3.75e-4; } - - front - { - type empty; - } - - back - { - type empty; - } } diff --git a/tutorials/incompressibleFluid/rotor2DSRF/0/k b/tutorials/incompressibleFluid/rotor2DSRF/0/k index e5b0a3ab7e..994e9d5a7a 100644 --- a/tutorials/incompressibleFluid/rotor2DSRF/0/k +++ b/tutorials/incompressibleFluid/rotor2DSRF/0/k @@ -20,6 +20,8 @@ internalField uniform 3.75e-3; boundaryField { + #includeEtc "caseDicts/setConstraintTypes" + rotor { type kqRWallFunction; @@ -31,16 +33,6 @@ boundaryField type inletOutlet; inletValue uniform 3.75e-3; } - - front - { - type empty; - } - - back - { - type empty; - } } diff --git a/tutorials/incompressibleFluid/rotor2DSRF/0/nut b/tutorials/incompressibleFluid/rotor2DSRF/0/nut index 63fc75f0c7..82a2a0f4ec 100644 --- a/tutorials/incompressibleFluid/rotor2DSRF/0/nut +++ b/tutorials/incompressibleFluid/rotor2DSRF/0/nut @@ -20,6 +20,8 @@ internalField uniform 0; boundaryField { + #includeEtc "caseDicts/setConstraintTypes" + rotor { type nutkWallFunction; @@ -31,16 +33,6 @@ boundaryField type calculated; value uniform 0; } - - front - { - type empty; - } - - back - { - type empty; - } } diff --git a/tutorials/incompressibleFluid/rotor2DSRF/0/p b/tutorials/incompressibleFluid/rotor2DSRF/0/p index 2de99b4fe2..8a453b60d0 100644 --- a/tutorials/incompressibleFluid/rotor2DSRF/0/p +++ b/tutorials/incompressibleFluid/rotor2DSRF/0/p @@ -9,6 +9,7 @@ FoamFile { format ascii; class volScalarField; + location "0"; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -19,6 +20,8 @@ internalField uniform 0; boundaryField { + #includeEtc "caseDicts/setConstraintTypes" + rotor { type zeroGradient; @@ -29,16 +32,6 @@ boundaryField type freestreamPressure; freestreamValue $internalField; } - - front - { - type empty; - } - - back - { - type empty; - } } // ************************************************************************* // diff --git a/tutorials/incompressibleFluid/rotor2DSRF/system/blockMeshDict b/tutorials/incompressibleFluid/rotor2DSRF/system/blockMeshDict index 149d7336fd..24a142e825 100644 --- a/tutorials/incompressibleFluid/rotor2DSRF/system/blockMeshDict +++ b/tutorials/incompressibleFluid/rotor2DSRF/system/blockMeshDict @@ -13,173 +13,18 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -convertToMeters 1.0; +nBlades 4; -hub 0.005; -rotorBlades 0.02; -freestream 0.1; -halfDepth 0.005; -angle 90; +rHub 0.005; +rTip 0.02; +rFreestream 0.1; -nRadialRotorCells 6; -nRadialOuterCells 24; -nCircCells 24; +halfDepth 0.005; -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +nCellsHubTip 6; +nCellsTipFreestream 24; +nCellsBladeBlade 24; -vertices #codeStream -{ - codeInclude - #{ - #include "pointField.H" - #include "transformField.H" - #}; - - code - #{ - const pointField initPoints - ({ - point(-$freestream, 0, -$halfDepth), - point(-$rotorBlades, 0, -$halfDepth), - point(-$hub, 0, -$halfDepth), - point(-$hub, 0, -$halfDepth), - }); - - pointField points; - - // Rotate points around z-axis and append - for (label i = 0; i < 4; i++) - { - points.append(transform(Rz(degToRad(i*$angle)), initPoints)); - } - - // Duplicate z points - points.append(points + vector(0, 0, 2*$halfDepth)); - - os << points; - #}; -}; - -rotorBlock ($nCircCells $nRadialRotorCells 1) simpleGrading (1 1 1); -outerBlock ($nCircCells $nRadialOuterCells 1) simpleGrading (1 1 1); - -blocks -( - hex (6 2 1 5 22 18 17 21) $rotorBlock - hex (10 7 5 9 26 23 21 25) $rotorBlock - hex (14 11 9 13 30 27 25 29) $rotorBlock - hex (3 15 13 1 19 31 29 17) $rotorBlock - - hex (5 1 0 4 21 17 16 20) $outerBlock - hex (9 5 4 8 25 21 20 24) $outerBlock - hex (13 9 8 12 29 25 24 28) $outerBlock - hex (1 13 12 0 17 29 28 16) $outerBlock -); - -circle $angle (0 0 1); - -edges -( - arc 2 6 $circle - arc 7 10 $circle - arc 11 14 $circle - arc 15 3 $circle - arc 18 22 $circle - arc 23 26 $circle - arc 27 30 $circle - arc 31 19 $circle - - arc 1 5 $circle - arc 5 9 $circle - arc 9 13 $circle - arc 13 1 $circle - arc 17 21 $circle - arc 21 25 $circle - arc 25 29 $circle - arc 29 17 $circle - - arc 0 4 $circle - arc 4 8 $circle - arc 8 12 $circle - arc 12 0 $circle - arc 16 20 $circle - arc 20 24 $circle - arc 24 28 $circle - arc 28 16 $circle - -); - -defaultPatch -{ - name walls; - type wall; -} - -boundary -( - rotor - { - type wall; - faces - ( - (2 18 22 6) - (7 23 26 10) - (11 27 30 14) - (15 31 19 3) - (1 17 18 2) - (17 1 3 19) - (5 21 22 6) - (21 5 7 23) - (26 10 9 25) - (11 27 25 9) - (30 14 13 29) - (29 13 15 31) - ); - } - - freestream - { - type patch; - faces - ( - (16 0 4 20) - (20 4 8 24) - (24 8 12 28) - (28 12 0 16) - ); - } - - front - { - type empty; - faces - ( - (17 21 22 18) - (21 25 26 23) - (25 29 30 27) - (29 17 19 31) - (16 20 21 17) - (20 24 25 21) - (25 24 28 29) - (29 28 16 17) - ); - } - - back - { - type empty; - faces - ( - (5 1 2 6) - (5 7 10 9) - (9 11 14 13) - (15 3 1 13) - (0 1 5 4) - (4 5 9 8) - (8 9 13 12) - (12 13 1 0) - ); - } -); +#include "$FOAM_TUTORIALS/resources/blockMesh/rotor2D" // ************************************************************************* // diff --git a/tutorials/incompressibleVoF/floatingObject/constant/dynamicMeshDict b/tutorials/incompressibleVoF/floatingObject/constant/dynamicMeshDict index b09f2d438d..d2a216367b 100644 --- a/tutorials/incompressibleVoF/floatingObject/constant/dynamicMeshDict +++ b/tutorials/incompressibleVoF/floatingObject/constant/dynamicMeshDict @@ -40,16 +40,13 @@ mover parent root; // Cuboid dimensions - Lx 0.3; - Ly 0.2; - Lz 0.5; + L (0.3 0.2 0.5); // Density of the cuboid rho 500; // Cuboid mass - mass #calc "$rho*$Lx*$Ly*$Lz"; - L ($Lx $Ly $Lz); + mass #calc "$rho*cmptProduct($L)"; centreOfMass (0 0 0.25); transform (1 0 0 0 1 0 0 0 1) (0.5 0.45 0.1); diff --git a/tutorials/incompressibleVoF/floatingObject/constant/dynamicMeshDict.sixDoF b/tutorials/incompressibleVoF/floatingObject/constant/dynamicMeshDict.sixDoF index 294ca17904..922886348c 100644 --- a/tutorials/incompressibleVoF/floatingObject/constant/dynamicMeshDict.sixDoF +++ b/tutorials/incompressibleVoF/floatingObject/constant/dynamicMeshDict.sixDoF @@ -30,34 +30,16 @@ mover centreOfMass (0.5 0.45 0.35); // Cuboid dimensions - Lx 0.3; - Ly 0.2; - Lz 0.5; + L (0.3 0.2 0.5); // Density of the solid rhoSolid 500; // Cuboid mass - mass #calc "$rhoSolid*$Lx*$Ly*$Lz"; + mass #calc "$rhoSolid*cmptProduct($L)"; // Cuboid moment of inertia about the centre of mass - momentOfInertia #codeStream - { - codeInclude - #{ - #include "diagTensor.H" - #}; - - code - #{ - scalar sqrLx = sqr($Lx); - scalar sqrLy = sqr($Ly); - scalar sqrLz = sqr($Lz); - os << - $mass - *diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/12.0; - #}; - }; + momentOfInertia #calc "$mass*(tensor::one-tensor::I)&cmptSqr($L)/12"; report on; accelerationRelaxation 0.7; diff --git a/tutorials/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict b/tutorials/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict index 6b3458e0bd..5868680a18 100644 --- a/tutorials/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict +++ b/tutorials/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict @@ -40,16 +40,13 @@ mover parent root; // Cuboid dimensions - Lx 0.3; - Ly 0.2; - Lz 0.5; + L (0.3 0.2 0.5); // Density of the cuboid rho 500; // Cuboid mass - mass #calc "$rho*$Lx*$Ly*$Lz"; - L ($Lx $Ly $Lz); + mass #calc "$rho*cmptProduct($L)"; centreOfMass (0 0 0.25); transform (1 0 0 0 1 0 0 0 1) (0.5 0.45 0.1); diff --git a/tutorials/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict.sixDoF b/tutorials/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict.sixDoF index 294ca17904..922886348c 100644 --- a/tutorials/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict.sixDoF +++ b/tutorials/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict.sixDoF @@ -30,34 +30,16 @@ mover centreOfMass (0.5 0.45 0.35); // Cuboid dimensions - Lx 0.3; - Ly 0.2; - Lz 0.5; + L (0.3 0.2 0.5); // Density of the solid rhoSolid 500; // Cuboid mass - mass #calc "$rhoSolid*$Lx*$Ly*$Lz"; + mass #calc "$rhoSolid*cmptProduct($L)"; // Cuboid moment of inertia about the centre of mass - momentOfInertia #codeStream - { - codeInclude - #{ - #include "diagTensor.H" - #}; - - code - #{ - scalar sqrLx = sqr($Lx); - scalar sqrLy = sqr($Ly); - scalar sqrLz = sqr($Lz); - os << - $mass - *diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/12.0; - #}; - }; + momentOfInertia #calc "$mass*(tensor::one-tensor::I)&cmptSqr($L)/12"; report on; accelerationRelaxation 0.7; diff --git a/tutorials/incompressibleVoF/mixerVesselHorizontal2D/system/createBafflesDict b/tutorials/incompressibleVoF/mixerVesselHorizontal2D/system/createBafflesDict index dbc0559e6e..04895ee5d6 100644 --- a/tutorials/incompressibleVoF/mixerVesselHorizontal2D/system/createBafflesDict +++ b/tutorials/incompressibleVoF/mixerVesselHorizontal2D/system/createBafflesDict @@ -25,7 +25,7 @@ baffles surface searchableCylinder; point1 (0 0 -100); point2 (0 0 100); - radius $rotorRegion; + radius $rMid; owner { diff --git a/tutorials/incompressibleVoF/sloshingTank3D/0/U b/tutorials/incompressibleVoF/sloshingTank3D/0/U index 729c6434b8..fd1f4e8a3a 100644 --- a/tutorials/incompressibleVoF/sloshingTank3D/0/U +++ b/tutorials/incompressibleVoF/sloshingTank3D/0/U @@ -19,7 +19,7 @@ internalField uniform (0 0 0); boundaryField { - walls + wall { type movingWallVelocity; value uniform (0 0 0); diff --git a/tutorials/incompressibleVoF/sloshingTank3D/0/alpha.water.orig b/tutorials/incompressibleVoF/sloshingTank3D/0/alpha.water.orig index a5e5fcd604..568ea36ba6 100644 --- a/tutorials/incompressibleVoF/sloshingTank3D/0/alpha.water.orig +++ b/tutorials/incompressibleVoF/sloshingTank3D/0/alpha.water.orig @@ -19,7 +19,7 @@ internalField uniform 0; boundaryField { - walls + wall { type zeroGradient; } diff --git a/tutorials/incompressibleVoF/sloshingTank3D/0/p_rgh b/tutorials/incompressibleVoF/sloshingTank3D/0/p_rgh index 117f012e90..b4d3167e18 100644 --- a/tutorials/incompressibleVoF/sloshingTank3D/0/p_rgh +++ b/tutorials/incompressibleVoF/sloshingTank3D/0/p_rgh @@ -19,7 +19,7 @@ internalField uniform 0; boundaryField { - walls + wall { type fixedFluxPressure; } diff --git a/tutorials/incompressibleVoF/sloshingTank3D3DoF/0/U b/tutorials/incompressibleVoF/sloshingTank3D3DoF/0/U index 729c6434b8..fd1f4e8a3a 100644 --- a/tutorials/incompressibleVoF/sloshingTank3D3DoF/0/U +++ b/tutorials/incompressibleVoF/sloshingTank3D3DoF/0/U @@ -19,7 +19,7 @@ internalField uniform (0 0 0); boundaryField { - walls + wall { type movingWallVelocity; value uniform (0 0 0); diff --git a/tutorials/incompressibleVoF/sloshingTank3D3DoF/0/alpha.water.orig b/tutorials/incompressibleVoF/sloshingTank3D3DoF/0/alpha.water.orig index a5e5fcd604..568ea36ba6 100644 --- a/tutorials/incompressibleVoF/sloshingTank3D3DoF/0/alpha.water.orig +++ b/tutorials/incompressibleVoF/sloshingTank3D3DoF/0/alpha.water.orig @@ -19,7 +19,7 @@ internalField uniform 0; boundaryField { - walls + wall { type zeroGradient; } diff --git a/tutorials/incompressibleVoF/sloshingTank3D3DoF/0/p_rgh b/tutorials/incompressibleVoF/sloshingTank3D3DoF/0/p_rgh index 117f012e90..b4d3167e18 100644 --- a/tutorials/incompressibleVoF/sloshingTank3D3DoF/0/p_rgh +++ b/tutorials/incompressibleVoF/sloshingTank3D3DoF/0/p_rgh @@ -19,7 +19,7 @@ internalField uniform 0; boundaryField { - walls + wall { type fixedFluxPressure; } diff --git a/tutorials/incompressibleVoF/sloshingTank3D6DoF/0/U b/tutorials/incompressibleVoF/sloshingTank3D6DoF/0/U index 729c6434b8..fd1f4e8a3a 100644 --- a/tutorials/incompressibleVoF/sloshingTank3D6DoF/0/U +++ b/tutorials/incompressibleVoF/sloshingTank3D6DoF/0/U @@ -19,7 +19,7 @@ internalField uniform (0 0 0); boundaryField { - walls + wall { type movingWallVelocity; value uniform (0 0 0); diff --git a/tutorials/incompressibleVoF/sloshingTank3D6DoF/0/alpha.water.orig b/tutorials/incompressibleVoF/sloshingTank3D6DoF/0/alpha.water.orig index a5e5fcd604..568ea36ba6 100644 --- a/tutorials/incompressibleVoF/sloshingTank3D6DoF/0/alpha.water.orig +++ b/tutorials/incompressibleVoF/sloshingTank3D6DoF/0/alpha.water.orig @@ -19,7 +19,7 @@ internalField uniform 0; boundaryField { - walls + wall { type zeroGradient; } diff --git a/tutorials/incompressibleVoF/sloshingTank3D6DoF/0/p_rgh b/tutorials/incompressibleVoF/sloshingTank3D6DoF/0/p_rgh index 117f012e90..b4d3167e18 100644 --- a/tutorials/incompressibleVoF/sloshingTank3D6DoF/0/p_rgh +++ b/tutorials/incompressibleVoF/sloshingTank3D6DoF/0/p_rgh @@ -19,7 +19,7 @@ internalField uniform 0; boundaryField { - walls + wall { type fixedFluxPressure; } diff --git a/tutorials/multiphaseEuler/mixerVessel2D/system/createBafflesDict b/tutorials/multiphaseEuler/mixerVessel2D/system/createBafflesDict index dbc0559e6e..04895ee5d6 100644 --- a/tutorials/multiphaseEuler/mixerVessel2D/system/createBafflesDict +++ b/tutorials/multiphaseEuler/mixerVessel2D/system/createBafflesDict @@ -25,7 +25,7 @@ baffles surface searchableCylinder; point1 (0 0 -100); point2 (0 0 100); - radius $rotorRegion; + radius $rMid; owner { diff --git a/tutorials/resources/blockMesh/mixerVessel2D b/tutorials/resources/blockMesh/mixerVessel2D index 497329cf37..0f3d65940d 100644 --- a/tutorials/resources/blockMesh/mixerVessel2D +++ b/tutorials/resources/blockMesh/mixerVessel2D @@ -13,19 +13,19 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -convertToMeters 1.0; +convertToMeters 1.0; -hub 0.02; -rotorBlades 0.05; -rotorRegion 0.06; -statorBlades 0.07; -stator 0.1; -halfDepth 0.005; -angle 45; +rHub 0.02; // Radius of the rotor hub +rRotorTip 0.05; // Radius of the rotor blade tips +rMid 0.06; // Radius of the midpoint between rotor and stator +rStatorTip 0.07; // Radius of the stator blade tips +rVessel 0.1; // Radius of the outer vessel wall -nRadialEndsCells 12; -nRadialMidsCells 4; -nCircCells 12; +halfDepth 0.005; // Half-depth of the 2-D slab + +nCellsRootTip 12; // Number of cells radially along the blades +nCellsMid 4; // Number of cells radially across the mid section (/2) +nCellsBladeBlade 12; // Number of cells tangentially between blades (/2) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -39,166 +39,162 @@ vertices #codeStream code #{ - const pointField initPoints + const pointField points0 ({ - point(-$stator, 0, -$halfDepth), - point(-$stator, 0, -$halfDepth), - point(-$statorBlades, 0, -$halfDepth), - point(-$rotorRegion, 0, -$halfDepth), - point(-$rotorBlades, 0, -$halfDepth), - point(-$hub, 0, -$halfDepth), - point(-$hub, 0, -$halfDepth), + point(-$rVessel, 0, -$halfDepth), + point(-$rVessel, 0, -$halfDepth), + point(-$rStatorTip, 0, -$halfDepth), + point(-$rMid, 0, -$halfDepth), + point(-$rRotorTip, 0, -$halfDepth), + point(-$rHub, 0, -$halfDepth), + point(-$rHub, 0, -$halfDepth), }); pointField points; - - // Rotate points around z-axis and append for (label i = 0; i < 8; i++) { - points.append(transform(Rz(degToRad(i*$angle)), initPoints)); + points.append(transform(Rz(degToRad(i*45)), points0)); } - - // Duplicate z points points.append(points + vector(0, 0, 2*$halfDepth)); os << points; #}; }; -hubTankBlocks ($nCircCells $nRadialEndsCells 1) simpleGrading (1 1 1); -middleBocks ($nCircCells $nRadialMidsCells 1) simpleGrading (1 1 1); +bladeBlock ($nCellsBladeBlade $nCellsRootTip 1) simpleGrading (1 1 1); +midBlock ($nCellsBladeBlade $nCellsMid 1) simpleGrading (1 1 1); blocks ( - hex (0 8 9 2 56 64 65 58) stator $hubTankBlocks - hex (2 9 10 3 58 65 66 59) stator $middleBocks - hex (3 10 11 4 59 66 67 60) rotor $middleBocks - hex (4 11 12 5 60 67 68 61) rotor $hubTankBlocks + hex (0 8 9 2 56 64 65 58) stator $bladeBlock + hex (2 9 10 3 58 65 66 59) stator $midBlock + hex (3 10 11 4 59 66 67 60) rotor $midBlock + hex (4 11 12 5 60 67 68 61) rotor $bladeBlock - hex (7 14 16 9 63 70 72 65) stator $hubTankBlocks - hex (9 16 17 10 65 72 73 66) stator $middleBocks - hex (10 17 18 11 66 73 74 67) rotor $middleBocks - hex (11 18 20 12 67 74 76 68) rotor $hubTankBlocks + hex (7 14 16 9 63 70 72 65) stator $bladeBlock + hex (9 16 17 10 65 72 73 66) stator $midBlock + hex (10 17 18 11 66 73 74 67) rotor $midBlock + hex (11 18 20 12 67 74 76 68) rotor $bladeBlock - hex (14 22 23 16 70 78 79 72) stator $hubTankBlocks - hex (16 23 24 17 72 79 80 73) stator $middleBocks - hex (17 24 25 18 73 80 81 74) rotor $middleBocks - hex (18 25 26 19 74 81 82 75) rotor $hubTankBlocks + hex (14 22 23 16 70 78 79 72) stator $bladeBlock + hex (16 23 24 17 72 79 80 73) stator $midBlock + hex (17 24 25 18 73 80 81 74) rotor $midBlock + hex (18 25 26 19 74 81 82 75) rotor $bladeBlock - hex (21 28 30 23 77 84 86 79) stator $hubTankBlocks - hex (23 30 31 24 79 86 87 80) stator $middleBocks - hex (24 31 32 25 80 87 88 81) rotor $middleBocks - hex (25 32 34 26 81 88 90 82) rotor $hubTankBlocks + hex (21 28 30 23 77 84 86 79) stator $bladeBlock + hex (23 30 31 24 79 86 87 80) stator $midBlock + hex (24 31 32 25 80 87 88 81) rotor $midBlock + hex (25 32 34 26 81 88 90 82) rotor $bladeBlock - hex (28 36 37 30 84 92 93 86) stator $hubTankBlocks - hex (30 37 38 31 86 93 94 87) stator $middleBocks - hex (31 38 39 32 87 94 95 88) rotor $middleBocks - hex (32 39 40 33 88 95 96 89) rotor $hubTankBlocks + hex (28 36 37 30 84 92 93 86) stator $bladeBlock + hex (30 37 38 31 86 93 94 87) stator $midBlock + hex (31 38 39 32 87 94 95 88) rotor $midBlock + hex (32 39 40 33 88 95 96 89) rotor $bladeBlock - hex (35 42 44 37 91 98 100 93) stator $hubTankBlocks - hex (37 44 45 38 93 100 101 94) stator $middleBocks - hex (38 45 46 39 94 101 102 95) rotor $middleBocks - hex (39 46 48 40 95 102 104 96) rotor $hubTankBlocks + hex (35 42 44 37 91 98 100 93) stator $bladeBlock + hex (37 44 45 38 93 100 101 94) stator $midBlock + hex (38 45 46 39 94 101 102 95) rotor $midBlock + hex (39 46 48 40 95 102 104 96) rotor $bladeBlock - hex (42 50 51 44 98 106 107 100) stator $hubTankBlocks - hex (44 51 52 45 100 107 108 101) stator $middleBocks - hex (45 52 53 46 101 108 109 102) rotor $middleBocks - hex (46 53 54 47 102 109 110 103) rotor $hubTankBlocks + hex (42 50 51 44 98 106 107 100) stator $bladeBlock + hex (44 51 52 45 100 107 108 101) stator $midBlock + hex (45 52 53 46 101 108 109 102) rotor $midBlock + hex (46 53 54 47 102 109 110 103) rotor $bladeBlock - hex (49 0 2 51 105 56 58 107) stator $hubTankBlocks - hex (51 2 3 52 107 58 59 108) stator $middleBocks - hex (52 3 4 53 108 59 60 109) rotor $middleBocks - hex (53 4 6 54 109 60 62 110) rotor $hubTankBlocks + hex (49 0 2 51 105 56 58 107) stator $bladeBlock + hex (51 2 3 52 107 58 59 108) stator $midBlock + hex (52 3 4 53 108 59 60 109) rotor $midBlock + hex (53 4 6 54 109 60 62 110) rotor $bladeBlock ); -circle $angle (0 0 1); +arc 45 (0 0 1); edges ( - arc 0 8 $circle - arc 7 14 $circle - arc 14 22 $circle - arc 21 28 $circle - arc 28 36 $circle - arc 35 42 $circle - arc 42 50 $circle - arc 49 0 $circle - arc 56 64 $circle - arc 63 70 $circle - arc 70 78 $circle - arc 77 84 $circle - arc 84 92 $circle - arc 91 98 $circle - arc 98 106 $circle - arc 105 56 $circle + arc 0 8 $arc + arc 7 14 $arc + arc 14 22 $arc + arc 21 28 $arc + arc 28 36 $arc + arc 35 42 $arc + arc 42 50 $arc + arc 49 0 $arc + arc 56 64 $arc + arc 63 70 $arc + arc 70 78 $arc + arc 77 84 $arc + arc 84 92 $arc + arc 91 98 $arc + arc 98 106 $arc + arc 105 56 $arc - arc 2 9 $circle - arc 9 16 $circle - arc 16 23 $circle - arc 23 30 $circle - arc 30 37 $circle - arc 37 44 $circle - arc 44 51 $circle - arc 51 2 $circle - arc 58 65 $circle - arc 65 72 $circle - arc 72 79 $circle - arc 79 86 $circle - arc 86 93 $circle - arc 93 100 $circle - arc 100 107 $circle - arc 107 58 $circle + arc 2 9 $arc + arc 9 16 $arc + arc 16 23 $arc + arc 23 30 $arc + arc 30 37 $arc + arc 37 44 $arc + arc 44 51 $arc + arc 51 2 $arc + arc 58 65 $arc + arc 65 72 $arc + arc 72 79 $arc + arc 79 86 $arc + arc 86 93 $arc + arc 93 100 $arc + arc 100 107 $arc + arc 107 58 $arc - arc 3 10 $circle - arc 10 17 $circle - arc 17 24 $circle - arc 24 31 $circle - arc 31 38 $circle - arc 38 45 $circle - arc 45 52 $circle - arc 52 3 $circle - arc 59 66 $circle - arc 66 73 $circle - arc 73 80 $circle - arc 80 87 $circle - arc 87 94 $circle - arc 94 101 $circle - arc 101 108 $circle - arc 108 59 $circle + arc 3 10 $arc + arc 10 17 $arc + arc 17 24 $arc + arc 24 31 $arc + arc 31 38 $arc + arc 38 45 $arc + arc 45 52 $arc + arc 52 3 $arc + arc 59 66 $arc + arc 66 73 $arc + arc 73 80 $arc + arc 80 87 $arc + arc 87 94 $arc + arc 94 101 $arc + arc 101 108 $arc + arc 108 59 $arc - arc 4 11 $circle - arc 11 18 $circle - arc 18 25 $circle - arc 25 32 $circle - arc 32 39 $circle - arc 39 46 $circle - arc 46 53 $circle - arc 53 4 $circle - arc 60 67 $circle - arc 67 74 $circle - arc 74 81 $circle - arc 81 88 $circle - arc 88 95 $circle - arc 95 102 $circle - arc 102 109 $circle - arc 109 60 $circle + arc 4 11 $arc + arc 11 18 $arc + arc 18 25 $arc + arc 25 32 $arc + arc 32 39 $arc + arc 39 46 $arc + arc 46 53 $arc + arc 53 4 $arc + arc 60 67 $arc + arc 67 74 $arc + arc 74 81 $arc + arc 81 88 $arc + arc 88 95 $arc + arc 95 102 $arc + arc 102 109 $arc + arc 109 60 $arc - arc 5 12 $circle - arc 12 20 $circle - arc 19 26 $circle - arc 26 34 $circle - arc 33 40 $circle - arc 40 48 $circle - arc 47 54 $circle - arc 54 6 $circle - arc 61 68 $circle - arc 68 76 $circle - arc 75 82 $circle - arc 82 90 $circle - arc 89 96 $circle - arc 96 104 $circle - arc 103 110 $circle - arc 110 62 $circle + arc 5 12 $arc + arc 12 20 $arc + arc 19 26 $arc + arc 26 34 $arc + arc 33 40 $arc + arc 40 48 $arc + arc 47 54 $arc + arc 54 6 $arc + arc 61 68 $arc + arc 68 76 $arc + arc 75 82 $arc + arc 82 90 $arc + arc 89 96 $arc + arc 96 104 $arc + arc 103 110 $arc + arc 110 62 $arc ); defaultPatch diff --git a/tutorials/resources/blockMesh/rotor2D b/tutorials/resources/blockMesh/rotor2D new file mode 100644 index 0000000000..6dd2412600 --- /dev/null +++ b/tutorials/resources/blockMesh/rotor2D @@ -0,0 +1,224 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// In the case system/blockMeshDict, set the following variables: + +/* + nBlades 4; // Number of rotor blades + + rHub 0.005; // Radius of the hub + rTip 0.02; // Radius of the blade tips + rFreestream 0.1; // Radius of the freestream boundary + + halfDepth 0.005; // Half-depth of the 2-D slab + + nCellsHubTip 6; // Number of cells radially from hub to blade tip + nCellsTipFreestream 24; // Number of cells radially from blade tip to the + // freestream boundary + nCellsBladeBlade 24; // Number of cells tangentially between blades +*/ + +// Then #include this file: + +/* + #include "$FOAM_TUTORIALS/resources/blockMesh/rotor2D" +*/ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +vertices #codeStream +{ + codeInclude + #{ + #include "pointField.H" + #include "SubField.H" + #include "transformField.H" + #}; + + code + #{ + // Get the radii. Note using $rHub instead of $rHub means that + // rHub can change without needing to recompile this code. The same is + // true for access of other settings throughout this file. + const scalarField rs + ({ + $rHub, + $rHub, + $rTip, + $rFreestream + }); + + // Create points for the blade aligned with the X-axis + pointField points(4, point(0, 0, -$halfDepth)); + points.replace(0, -rs); + + // Create equivalent points for other blades by rotating + for (label i = 1; i < $