
[Sponsors] 
May 7, 2020, 01:26 
komega SST: omega, nut are not computed correctly

#1 
New Member
Arash
Join Date: May 2017
Posts: 17
Rep Power: 8 
I'm trying to simulate a rotating 2D airfoil in the wind. For that, I have defined a rotating region that encompasses my airfoil and a static region for the rest of the domain. To couple the two regions, I used cyclicAMI.
I managed to set up a working case using komega SST for turbulent flow. The result of p,U and k are reasonable. Yet, I see a large discontinuity in the coupled interface for omega and nut regardless of mesh refinement level. It seems that for these two parameters the solution in the static region is not really influenced by rotating and these fields (more or less) preserve their initial values Look at the pictures below. p field (it's fine) U field (it's fine) k field (it's fine) nut (it's NOT fine) omega (it's NOT fine) This happens when I use my own mesh generated by gmsh and not with snappyHexMesh utility. To put in more contrast, I made a mesh using snappyHexMesh and observed that this discontinuity doesn't occur. This showed me that whatever is causing this issue involves the create Baffle/Patchs. UPDATE: In the snappy case, the mesh had no boundary layer (for speedup). After I made a lighter case of the same problem using gmsh but with no boundary layer, the problem resolved somehow! it's just an observation. I'm not really suggesting that the boundary layer is causing the problem here. How I make my mesh in gmsh? To be able to define the sliding interface, I define a physical surface in gmsh (called AMI). This internal face has to be later baffled. The full list of physical surfaces defined in gmsh are  AMI  Inlet (type > inlet)  Outlet (type > outlet)  Airfoil (type > wall)  TopBottom  FrontEnd (type > empty) I use gmshToFoam to make polyMesh folder. I later, edit the boundary file such that the patch types coincide with the expressions in the parenthesis above. How I set up my BafflesDict? Here is my baffle dict to transform the AMI into two patches. Code:
internalFacesOnly true; baffles { cyclicAMI { // Use predefined faceZone to select faces and orientation. type faceZone; zoneName AMI; patches { master //fix { // Master side patch name AMI1; type cyclicAMI; matchTolerance 0.0001; neighbourPatch AMI2; transform noOrdering; // Switch to zerogradient for low weights lowWeightCorrection 0.2; inGroups(Rotating); } slave //rotating { // Slave side patch name AMI2; type cyclicAMI; matchTolerance 0.0001; neighbourPatch AMI1; transform noOrdering; lowWeightCorrection 0.2; inGroups(Stationary); } } } } Code:
createBaffles overwrite; mergeOrSplitBaffles split overwrite I first run a steadystate case with simpleFoam and later use its converged values as the initial condition for the transientstate solver (pimpleFoam). Initial conditions for the steadystate case (before baffling) have the following structure (this is actually for k, the rest are similar) Code:
internalField uniform 24; boundaryField { TopBottom { type inletOutlet; inletValue uniform 24; value uniform 24; } Inlet { type freestream; freestreamValue uniform 24; value uniform 24; } Outlet { type inletOutlet; inletValue uniform 24; value uniform 24; } FrontBack { type empty; } Airfoil { type kqRWallFunction; value uniform 24; } AMI { type slip; } } Code:
internalField uniform 24; boundaryField { FrontBack { type empty; } TopBottom { type inletOutlet; inletValue uniform 24; value uniform 24; } Inlet { type freestream; freestreamValue uniform 24; value uniform 24; } Outlet { type inletOutlet; inletValue uniform 24; value uniform 24; } Airfoil { type kqRWallFunction; value uniform 24; } AMI1 { type cyclicAMI; value uniform 0; } AMI2 { type cyclicAMI; value uniform 0; } } Other relevant info openFoam version: v1812 fvScheme Code:
ddtSchemes { default Euler; } gradSchemes { default Gauss linear; grad(p) Gauss linear; grad(U) Gauss linear; } divSchemes { default none; div(phi,U) Gauss linearUpwind grad(U); div(phi,k) Gauss upwind;//limitedLinear 1; div(phi,omega) Gauss upwind;//limitedLinear 1; div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear limited corrected 0.5; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } wallDist { method meshWave; } Code:
solvers { "pcorr.*" { solver GAMG; tolerance 1e7; relTol 0.01; smoother GaussSeidel; } p { $pcorr; tolerance 1e7; relTol 0.01; } pFinal { $p; tolerance 1e8; relTol 0; } "(Ukomega)" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e07; relTol 0.1; } "(Ukomega)Final" { $U; tolerance 1e08; relTol 0; } /* cellDisplacement { solver GAMG; tolerance 1e5; relTol 0; smoother GaussSeidel; } */ } PIMPLE { correctPhi yes; nOuterCorrectors 100; nCorrectors 2; nNonOrthogonalCorrectors 2; residualControl { p { relTol 0.001; tolerance 1e7; } "(Ukomega)" { relTol 0.01; tolerance 1e7; } } } relaxationFactors { fields { p 0.9; } equations { "(Ukomega)" 0.7; "(Ukomega)Final" 1.0; } } cache { grad(U); } Code:
application pimpleFoam; startFrom latestTime; startTime 0; stopAt endTime; endTime 1; deltaT 0.001; writeControl adjustableRunTime; writeInterval 0.01; purgeWrite 0; writeFormat ascii; writePrecision 7; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; adjustTimeStep yes; maxCo 5; Code:
dynamicFvMesh dynamicMotionSolverFvMesh; motionSolver solidBody; cellZone Rotating; solidBodyMotionFunction oscillatingRotatingMotion; origin (0.5 0 0); amplitude (0 0 28); // degree [it's weird though that this is not in rad] omega 1.884955592; // 2*Pi*f_mean rad/s Arash Last edited by arashgmn; May 9, 2020 at 06:44. Reason: A better title that addresses the solution better 

May 7, 2020, 17:42 

#2 
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12 
>> This happens when I use my own mesh generated by gmsh and not with snappyHexMesh utility.
Might be related to the fact that the type of cells is tetrahedron in GMSH? I think your observation suggests that. If you can create a hexahedronbased mesh in GMSH and test it  you can isolate the matter further.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki1/Wiki2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESIOpenCFDTrademark) Bugs/Features: FOAMExtend (WikkiFSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror 

May 7, 2020, 18:32 

#3  
New Member
Arash
Join Date: May 2017
Posts: 17
Rep Power: 8 
Quote:
My observations hint that the boundary layer somehow is involved but I don't really see any link! I'm very confused! 

May 9, 2020, 06:43 

#4 
New Member
Arash
Join Date: May 2017
Posts: 17
Rep Power: 8 
So I found the reason and the solution.
Only omega and nut seem wrong. This means they affect each other somehow. As nut is not computed indirectly in komega SST, we can conclude that the computation of omega is wrong. I realized the omega field outside of the inner circle, is constant by time. It didn't evolve. This led me to the fact that maybe the tolerance for omega is too high which was the case. After setting a tolerance of 1e9 for omega, everything seemed to work normally. Take home message In turbulent fluids, the omega will change mostly around the wall. So if the wall boundaries are only a small fraction of your total cells, the residuals might be dominated by the almostconstant areas of the domain. Hence, it's probably a good practice to choose a small tolerance for omega. 

Tags 
baffle interface, cyclic ami, gmsh 4.5.4, snapphhexmesh 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Dynamic Mesh and Sliding Mesh Simultaneously  reynold92  FLUENT  2  May 9, 2015 15:26 
3D Hybrid Mesh Errors  DarrenC  ANSYS Meshing & Geometry  11  August 5, 2013 06:42 
[snappyHexMesh] Layers:problem with curvature  giulio.topazio  OpenFOAM Meshing & Mesh Conversion  10  August 22, 2012 09:03 
[Gmsh] 2D Mesh Generation Tutorial for GMSH  aeroslacker  OpenFOAM Meshing & Mesh Conversion  12  January 19, 2012 03:52 
dynamic mesh and sliding mesh  nasser  FLUENT  0  November 1, 2005 02:37 