CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Rotating Mesh with pympleDyMFoam (https://www.cfd-online.com/Forums/openfoam-solving/158221-rotating-mesh-pympledymfoam.html)

WernerW August 18, 2015 17:30

Rotating Mesh with pympleDyMFoam
 
5 Attachment(s)
Dear Forum,

I'm trying to simulate the performance of a Wind turbine with pimpleDyMFoam and I'm following the tutorial incompressible/pimpleDyMFoam/propeller. I'm running the model with the Allrun script and I think I'm doing everything as in the tutorial but when I generate my Mesh and even when I run the solver I can't see the wind turbine rotating. Futhermore the whole BlockMesh rotates as the simulation runs, which is very strange.

Has anyone faced this kind of problem ?

I'm pasting my snappyHexMesh,

Quote:

castellatedMesh true; // make basic mesh ?
snap true; // decide to snap back to surface ?
addLayers true; // decide to add viscous layers ?

geometry // Load in STL files here
{
RotorAsm.stl // STL filename
{
type triSurfaceMesh;
name rotor;
regions
{
ascii
{
name rotor;
}
}
}

Cylinder.stl
{
type triSurfaceMesh;
name Cylinder;
regions
{
ascii
{
name Cylinder;
}
}
}
};

// Settings for the castellatedMesh generation.
castellatedMeshControls
{
maxLocalCells 1000000; //max cells per CPU core
maxGlobalCells 2000000; //max cells to use before mesh deletion step
minRefinementCells 10; //was 0 - zero means no bad cells are allowed during refinement stages
maxLoadUnbalance 0.10;
nCellsBetweenLevels 3; // expansion factor between each high & low refinement zone

// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

features
(
{ file "RotorAsm.eMesh"; level 2;}

{ file "Cylinder.eMesh"; level 2;}

);

// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~

refinementSurfaces // Surface-wise min and max refinement level
{
rotor {level (2 2);}
Cylinder {
level (2 2);
faceType boundary;
cellZone Cylinder;
faceZone Cylinder;
cellzoneInside inside;
}

} // Surface-wise min and max refinement level

resolveFeatureAngle 30; // Resolve sharp angles

// Region-wise refinement
// ~~~~~~~~~~~~~~~~~~~~~~

refinementRegions // In descending levels of fine-ness
{
Cylinder
{
mode inside;
levels ((1E2 2));
}
}

locationInMesh (50.31415912 100.31415912 100.31415912);

allowFreeStandingZoneFaces false;
}

// Settings for the snapping.
snapControls
{
nSmoothPatch 3;
tolerance 4.0;
nSolveIter 30;
nRelaxIter 5;
nFeatureSnapIter 10; // default is 10

// New settings from openfoam 2.2 onwards for SHMesh

implicitFeatureSnap false; // default is false - detects without doing surfaceFeatureExtract
explicitFeatureSnap true; // default is true
multiRegionFeatureSnap false; // default is false - detects features between multiple surfaces

}

// Settings for the layer addition.
addLayersControls
{
relativeSizes true; // was true
layers
{
rotor {nSurfaceLayers 1;} // was 3
}
expansionRatio 1.3;
finalLayerThickness 0.3; //was 0.00016
minThickness 0.1; //was 0.00008
nGrow 1; // was 1

// Advanced settings

featureAngle 80; // was 70 //- When not to extrude surface. 0 is flat, 90 is right angle.
nRelaxIter 3; //- Max# of snapping relaxation iter. Should stop before upon reaching a correct mesh.
nSmoothSurfaceNormals 1; // Number of smoothing iterations of surface normals
nSmoothNormals 3; // Number of smoothing iterations of interior mesh movement direction
nSmoothThickness 10; // Smooth layer thickness over surface patches
maxFaceThicknessRatio 0.5; // Stop layer growth on highly warped cells
maxThicknessToMedialRatio 0.3; // Reduce layer growth where ratio thickness to medial distance is large
minMedianAxisAngle 90; // Angle used to pick up medial axis points
nBufferCellsNoExtrude 0; // Create buffer region for new layer terminations
nLayerIter 50; // Overall max number of layer addition iterations
}

// Generic mesh quality settings. At any undoable phase these determine
// where to undo.

meshQualityControls
{
maxNonOrtho 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minFlatness 0.5;
minVol 1e-13;
minTetQuality -1;
minArea -1;
minTwist 0.02;
minDeterminant 0.001;
minFaceWeight 0.05;
minVolRatio 0.01;
minTriangleTwist -1;

// Advanced

nSmoothScale 4;
errorReduction 0.75;
relaxed
{
//- Maximum non-orthogonality allowed. Set to 180 to disable.
maxNonOrtho 75;
}
}

// Advanced
//debug 0;

// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6;
DynamicMeshDict

Quote:

dynamicFvMesh solidBodyMotionFvMesh;

motionSolverLibs ( "libfvMotionSolvers.so" );

solidBodyMotionFvMeshCoeffs
{
cellZone Cylinder;

solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
origin (0 0 0);
axis (1 0 0);
omega 158; // rad/s
}
}

and my U

Quote:

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{

//- Set patchGroups for constraint patches
#includeEtc "caseDicts/setConstraintTypes"

inlet
{
type fixedValue;
value uniform (7.5 0 0);
}

outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}

sides
{
type zeroGradient; //freestream;
//$internalField;
}

rotor
{
type movingWallVelocity;
value uniform (0 0 0);
}
}
files and a couple of images.

Thanks in advance for your help.

WernerW August 20, 2015 14:34

Ok, Using paraFoam I discovered that the cellZone Cylinder includes all the boundary outside of the Cylinder. My mistake (discovered after struggling a lot) is that I defined the cellZone of the Cilinder wrongly. In SnappyHexMesh, in refinementeSurfaces, where I define the cellZone of the Cylinder, I wrote cellzoneInside and it should be cellZoneInside. With this I'm able to solve my simulation properly.
I hope this is useful ;)


All times are GMT -4. The time now is 14:52.