diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/U b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/U index 90e6da3660..1e3ab7c96f 100644 --- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/U +++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/U @@ -14,7 +14,27 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Uinlet (250 0 0); +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)); #}; +}; + +Uinlet #codeStream +{ + codeInclude #{ #include "vector.H" #}; + code #{ os << $speed*vector(::cos($angle), 0, ::sin($angle)); #}; +}; dimensions [0 1 -1 0 0 0 0]; diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/k b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/k index 878004659c..c264fc1d71 100644 --- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/k +++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/k @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -kInlet 0.01; +kInlet 1e-3; dimensions [0 2 -2 0 0 0 0]; diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/omega b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/omega index 2747824952..6c096b1cb9 100644 --- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/omega +++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/0/omega @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -omegaInlet 10; +omegaInlet 1; dimensions [0 0 -1 0 0 0 0]; diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allclean b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allclean index 6454204f7b..16ccadd1d3 100755 --- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allclean +++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allclean @@ -9,6 +9,7 @@ rm -f constant/geometry/NACA0012.obj.gz > /dev/null 2>&1 cleanCase +rm 0/Ma > /dev/null 2>&1 rm constant/geometry/boundaryLayer.obj > /dev/null 2>&1 #------------------------------------------------------------------------------ diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/blockMeshDict b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/blockMeshDict index 8ec817339a..87bd355f51 100644 --- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/blockMeshDict +++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/blockMeshDict @@ -17,22 +17,23 @@ FoamFile domain { - xMin -4; - xMax 4; - zMin -2; - zMax 2; + xMax 100; + zMax 50; + + xMin #neg $xMax; + zMin #neg $zMax; // Number of cells - zCells 80; // aerofoil to far field - xUCells 30; // upstream - xMCells 30; // middle - xDCells 40; // downstream + zCells 60; // aerofoil to far field + xUCells 60; // upstream + xMCells 25; // middle + xDCells 50; // downstream // Mesh grading - zGrading 40; // aerofoil to far field - xUGrading 5; // towards centre upstream - leadGrading 0.2; // towards leading edge - xDGrading 10; // downstream + zGrading 30000; // aerofoil to far field + xUGrading 10; // towards centre upstream + leadGrading 0.005; // towards leading edge + xDGrading 400; // downstream } aerofoil @@ -43,8 +44,9 @@ aerofoil zTrail 0; xUpper 0.3; zUpper 0.06; - xLower 0.3; - zLower -0.06; + + xLower $xUpper; + zLower #neg $zUpper; } geometry diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/controlDict b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/controlDict index 4e1c4f2f2a..675de1ba7e 100644 --- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/controlDict +++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/controlDict @@ -22,7 +22,7 @@ startTime 0; stopAt endTime; -endTime 1000; +endTime 2000; deltaT 1; @@ -34,7 +34,7 @@ purgeWrite 0; writeFormat ascii; -writePrecision 8; +writePrecision 10; writeCompression off; @@ -48,6 +48,7 @@ functions { #includeFunc MachNo #includeFunc residuals + #includeFunc forceCoeffsCompressible } // ************************************************************************* // diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/extrudeMeshDict b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/extrudeMeshDict index 34075dde2d..80524da3b6 100644 --- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/extrudeMeshDict +++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/extrudeMeshDict @@ -21,7 +21,7 @@ sourcePatches (back); exposedPatchName front; extrudeModel plane; -thickness 0.1; +thickness 1; flipNormals false; mergeFaces false; diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/forceCoeffsCompressible b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/forceCoeffsCompressible new file mode 100644 index 0000000000..6d5fa6e26a --- /dev/null +++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/forceCoeffsCompressible @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Web: www.OpenFOAM.org + \\/ M anipulation | +------------------------------------------------------------------------------- +Description + Calculates lift, drag and moment coefficients by summing forces on + specified patches for a case where the solver is compressible (pressure is + in units M/(LT^2), e.g. Pa). + +\*---------------------------------------------------------------------------*/ + +#include "$FOAM_CASE/0/U" + +patches (aerofoil); + +magUInf $speed; +lRef 1; +Aref 1; // span +rhoInf 1.2; + +CofR (0.2 0 0); +pitchAxis (0 1 0); + +#includeEtc "caseDicts/postProcessing/forces/forceCoeffs.cfg" + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvSolution b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvSolution index 9362797379..f441c9fc7c 100644 --- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvSolution +++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvSolution @@ -20,7 +20,7 @@ solvers { solver GAMG; smoother GaussSeidel; - tolerance 1e-6; + tolerance 1e-8; relTol 0.01; } @@ -28,7 +28,7 @@ solvers { solver PBiCGStab; preconditioner DILU; - tolerance 1e-6; + tolerance 1e-10; relTol 0.1; } } @@ -37,9 +37,9 @@ SIMPLE { residualControl { - p 1e-4; - U 1e-4; - "(k|omega|e)" 1e-4; + p 1e-6; + U 1e-5; + "(k|omega|e)" 1e-5; } nNonOrthogonalCorrectors 0; @@ -51,12 +51,12 @@ relaxationFactors { fields { - p 0.7; + p 0.3; rho 0.01; } equations { - U 0.3; + U 0.7; e 0.7; "(k|omega)" 0.7; }