CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [mesh manipulation] Prevent cell skewing in DynamicMesh ??? (https://www.cfd-online.com/Forums/openfoam-meshing/176063-prevent-cell-skewing-dynamicmesh.html)

iy-a August 10, 2016 11:28

Prevent cell skewing in DynamicMesh ???
 
2 Attachment(s)
I am simulating a 2D flow around a rotating structure,
using dynamicMeshDict with sixDoFRigidBodyMotion solver,
based on pimpleDyMFoam's wingmotion example.

Attached pictures show how cell skewness increased just
before simulation diverges completely because of mesh unconsistency.

Do I have to specify an other solver for the mesh to stay consistent ?
If yes, can I keep information (blue) containted the solver's "Coeffs" ?

I am using OF 4.
iy-a.


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh dynamicMotionSolverFvMesh;

motionSolverLibs ("libsixDoFRigidBodyMotion.so");

solver sixDoFRigidBodyMotion;

sixDoFRigidBodyMotionCoeffs
{
patches (wing);
innerDistance 0.3;
outerDistance 1;

mass 17;
centreOfMass (0.5 0 0.125);
momentOfInertia (1 1 2);
orientation
(
0.9953705935 0.09611129781 0
-0.09611129781 0.9953705935 0
0 0 1
);

g (0 0 -9.81);
rho rhoInf;
rhoInf 1;
report on;

solver
{
type symplectic;
}

constraints
{
yLine
{
sixDoFRigidBodyMotionConstrain
t line;
centreOfRotation (0.5 0 0.125);
direction (0 1 0);
}

xLine
{
sixDoFRigidBodyMotionConstrain
t line;
direction (1 0 0);
}

zAxis
{
sixDoFRigidBodyMotionConstrain
t axis;
axis (0 0 1);
}
}


}


// ************************************************** *********************** //

tomf August 11, 2016 03:56

Please have a look at the cyclicAMI interface (look for the mixervessel2D tutorial). This can give you a sliding interface, which you will need to keep the mesh from distorting.

iy-a August 11, 2016 07:29

Thank you Tom for the quick answer.

I have looked at the mixervesselAMI2D example,
and tried to replace the projectionSurface.stl and
dynamicMeshDict with mines but the mesh stayed circular.
I guess I have to generate a bunch of other files,
including the blockMeshDict. But for my geometry,
snappyHexMeshDict is needed, as in the propeller example.

Thus, I have tried to look at the files responsible of changing
the topology. It seems here that topoSet (selecting AMI patch cells)
and blockMesh (re-making mesh) are running in a loop in the Allrun file.
But I don't get how to set blockMesh / snappyHexMesh in my specific case.

I am now trying to follow these steps :
- implement topoSetDict with cellSet (?) criteria, detecting distorted cells.
- and then createPatch -overwrite (as in the propeller example) to set
the moving AMI ?

I'd appreciate some guidance/documentation on how to set up
blockMesh and SHM dictionaries acccording to AMI settings.

tomf August 11, 2016 08:07

The propellor tutorial also uses AMI interfaces, so I think you should look at how they are created and try to understand how this works (Look at the topoSet and createPatch parts and carefully investigate the snappyHexMeshDict).

The general idea is that you create a pair of patches, one connected to the rotating part of the mesh, the other to the stagnant part of the mesh. Try to go over the propellor tutorial until you understand every step, than replace that geometry with your geometry and keep track of te orientation that is needed.

Hope this helps.

Kind regards,
Tom

iy-a August 12, 2016 10:47

Thanks ! But it is tricky to tweak as the following points are the main differences with the propeller case :

- mine is 2D and has to stay as it is, as I need to carry lots of tests.
- mine is vertical , propeller is horizontal.
- mine is passive, propeller has an imposed spin.

For the last point, I guess I just have to replace the dynamicMeshDict with mine.
However, the penultimate point assumes that I should make the cyclicAMI spinning
along a different axis, or change the "container" geometry, and maybe its inlet/outlet.
It is hard to make these two cases merge as they function very differently :

- 2D wingmotion case separates its SHM,simpleFoam,pimpleDyMFoam in 3 directories.
- I tried to make cylinders intersect with my initial geometry in order to implement cyclicAMI but it is not sufficient to make it work.

I've struggled two days trying to adapt wingmotion2D on a cyclicAMI,
and didn't succeed in anything. I Found old examples of 2D passive cyclicAMI
with I/O as fanwing2D but after many file repairs to make it compatible with OF4 solver still complained.

Thus, it would probably be easier to modify mixervessel2DAMI's example, as you suggested.
But it doesn't have any snappyHexMeshDict, and I might have to use swiftSnap to make myself one.
projectionSurface.stl is the cyclicAMI open surface as far as I understood from visualizing it, and topoSetDict
gets the AMI foam file from polyMesyh/sets/AMI. These are the steps I would like to accomplish :

- change the "rotor" and "stator" geometries with mine. Is swiftSnap appropriate to generate their mesh directories ?
- Add inlet / outlet zones, but not sure how to proceed for this, as this example has no I/O initially. Any clue appreciated.

tomf August 12, 2016 12:23

Yes, you need to have 2D mesh with AMI to get what you want. I hope someone with more experience with snappyHexMesh, extrudeMesh and AMI can help you with that. For the inlet and outlet, you just need to expand your domain to the front and rear and than apply a fixed velocity inlet and a fixed pressure outlet (see for example the pitzDaily tutorials).


All times are GMT -4. The time now is 11:30.