CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Bird Wing simulation suggestions (https://www.cfd-online.com/Forums/openfoam/122751-bird-wing-simulation-suggestions.html)

c0sk August 27, 2013 08:56

Bird Wing simulation suggestions
 
Hi!!!
As stated in the title, for my third year undergraduate project I would like to simulate the flight of an hummingbird. The complexity involved is greater than the one required for an undergrad thesis, therefore, my supervisor recommended me to concentrate on the wing alone. He suggested to reduce it to a small, thin ellipse and assign to it the special rotation (infinity sign alike?!). He said OpenFoam is a powerlful tool so I am getting used to it over summer in order to be ready for october. I went through the user guide provided and installed the 1.6ext where there is a rotating motion solver which may fit my case. How would you proceed? Is there a specific solver/tool which may help me in simulating the wing and extract useful data such as the variation of Lift and Drag with the movement etc? What solver or utility do you reckon is required for my case? How will I be able to produce the mesh and give to it the rotation? The part is currently a Solidworks CAD file. Any suggestion is more than welcome!! Thanks! :D

cutter August 27, 2013 09:27

Hi, welcome to the forum,

I'm not into the topic myself, but there was someone asking similar questions just a few weeks ago concerning the flight of mosquitos. Search the forum for 'mosquito', this should be a good starting point.

cutter

c0sk August 27, 2013 12:10

Thanks, for the reply, I had already seen that and I am currently going through Frank Bos thesis. However my case is slightly different because I do not have any coordinate for the different positions assumed by the wing and I have no idea how to proceed in this sense :confused:

wyldckat September 7, 2013 09:36

Greetings to all!

@Andrea: I'll quote your question from the other thread:
Quote:

Originally Posted by c0sk (Post 450109)
My project consists in simulating the wing of an hummingbird, therefore applying that movement via the RBF motion function. What would you recommend as a starting point? Any guide/tutorial which can help me in doing this? I am currently going through Frank Bos Thesis which is a good start. How do you create the geometry (a simple ellipse) in a CAD software ( I mean just the ellipse, or the ellipse in a "box")?

Check this page and the links provided there: http://openfoamwiki.net/index.php/Blender

Beyond this, in case you don't want to use a CAD software, basically what you're looking for is a deformed circle. Check the tutorials that use the feature "arc" that blockMesh has got. For example, the 2nd tutorial on the User Guide is one of those cases: http://www.openfoam.org/docs/user/plateHole.php

Best regards,
Bruno

c0sk October 2, 2013 10:49

1 Attachment(s)
Quote:

Originally Posted by wyldckat (Post 450384)
Greetings to all!

@Andrea: I'll quote your question from the other thread:

Check this page and the links provided there: http://openfoamwiki.net/index.php/Blender

Beyond this, in case you don't want to use a CAD software, basically what you're looking for is a deformed circle. Check the tutorials that use the feature "arc" that blockMesh has got. For example, the 2nd tutorial on the User Guide is one of those cases: http://www.openfoam.org/docs/user/plateHole.php

Best regards,
Bruno

Thanks!
I have been going through the Blender tutorial, however a cannot get any good blockMeshdict or snappyHex one.
In the image my simple geometry is shown (.001m thick). I am probably doing something wrong while setting the patches because in the BMdict I only get a vast number of vertices and no actual patches coordinates.
I have tried both autodetect features and selecting manually the edges.

Note: the geometry has been imported as an stl file from Solidworks

wyldckat October 6, 2013 12:01

Hi Andrea,

There isn't much I can do to help, without at least an example case of what you're doing.

By the way, did you read this tutorial: http://openfoamwiki.net/index.php/Tut_andrew_blender :confused:

Best regards,
Bruno

c0sk October 9, 2013 11:55

I had a look at that but for the moment I decided to focus on a 2D case by applying the RBF function to the basic airfoil in the tutorial folder (pimpleDyMFoam).
BTW can RBF motion solver be applied to 3d models?
Assuming that I would like to create a full 3D model, and make 2 patches out of the wings, can I apply that movement? Thank you so much!!!

Basically, how do I do something similar to this http://www.youtube.com/watch?v=i6ECzy0jYxE ? :(

wyldckat October 13, 2013 04:52

Hi Andrea,

According to what I briefly saw in Frank Bos' thesis - http://repository.tudelft.nl/assets/...daa1b2/bos.pdf - it does seem to work in 3D as well.

Best regards,
Bruno

c0sk October 13, 2013 18:39

1 Attachment(s)
Quote:

Originally Posted by wyldckat (Post 456620)
Hi Andrea,

According to what I briefly saw in Frank Bos' thesis - http://repository.tudelft.nl/assets/...daa1b2/bos.pdf - it does seem to work in 3D as well.

Best regards,
Bruno

Thanks Bruno!
I read his work as well, I did get decent result in the 2D case. Im now into the 3D case but cant get the simple mesh. I keep getting the error

Code:

--> FOAM FATAL ERROR:
Point (0 0 0) is not inside the mesh or on a face or edge.
Bounding box of the mesh:(-4.04979 0.245944 -0.0556248) (4.04975 6.75322 5.42435)

    From function refinementParameters::findCells(const polyMesh&) const
    in file autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C at line 110.

This is what my snappyHexMeshDict looks like
Code:

castellatedMesh true;
snap            true;
addLayers      false;

geometry
{
    wingL.stl
    {
        type triSurfaceMesh;
        name wingL;
    }
    wingR.stl
    {
        type triSurfaceMesh;
        name wingR;
    }
    defaultName.stl
    {
        type triSurfaceMesh;
        name defaultName;
    }
    body.stl
    {
        type triSurfaceMesh;
        name body;
    }
};

castellatedMeshControls
{
    features
    (
    );
    refinementSurfaces
    {
        wingL
        {
            level (0 0);
            patchInfo
            {
                type patch;
            }
        }
        wingR
        {
            level (2 2);
            patchInfo
            {
                type wall;
            }
        }
        defaultName
        {
            level (0 0);
            patchInfo
            {
                type wall;
            }
        }
        body
        {
            level (1 1);
            patchInfo
            {
                type patch;
            }
        }
    }
    refinementRegions
    {
    }
  locationInMesh (0 0 0) ;

    maxLocalCells 100000;
    maxGlobalCells 2000000;
    minRefinementCells 0;
    nCellsBetweenLevels 1;
    resolveFeatureAngle 30.0;
    allowFreeStandingZoneFaces true;
}

addLayersControls
{
    layers
    {
        "wingL.*"
        {
            nSurfaceLayers 0;
        }
        "wingR.*"
        {
            nSurfaceLayers 0;
        }
        "defaultName.*"
        {
            nSurfaceLayers 0;
        }
        "body.*"
        {
            nSurfaceLayers 0;
        }
    }

    relativeSizes true;
    expansionRatio 1.25;
    finalLayerThickness 0.3;
    minThickness 0.25;
    nGrow 0;
    featureAngle 30;
    slipFeatureAngle 30;
    nRelaxIter 5;
    nSmoothSurfaceNormals 1;
    nSmoothNormals 3;
    nSmoothThickness 10;
    maxFaceThicknessRatio 0.5;
    maxThicknessToMedialRatio 0.3;
    minMedianAxisAngle 90;
    nBufferCellsNoExtrude 0;
    nLayerIter 50;
    nRelaxedIter 20;
    nLayerIter 50;
}

snapControls
{
    nSmoothPatch 3;
    tolerance 1.0;
    nSolveIter 300;
    nRelaxIter 5;
    nFeatureSnapIter 10;
    implicitFeatureSnap false;
    explicitFeatureSnap true;
    multiRegionFeatureSnap false;
}

meshQualityControls
{
    maxNonOrtho 65;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave 80;
    minVol 1e-13;
    minTetQuality 1e-30;
    minArea -1;
    minTwist 0.05;
    minDeterminant 0.001;
    minFaceWeight 0.05;
    minVolRatio 0.01;
    minTriangleTwist -1;
    nSmoothScale 4;
    errorReduction 0.75;
    relaxed
    {
        maxNonOrtho 75;
    }
}

debug 0;
mergeTolerance 1E-6;

Sorry to bother you but I keep hitting obstacles
:(


Edit: I changed the blockMeshDict to a different one and now I dont get that message anymore but snappyHexMesh run. It finisher very very soon and effectively doesnt do anything as the only thing I can see in paraview is the box. I can open the geometry itself and it is fine and fits conpletely in the box. I attached snappy's Log.

Andrea

wyldckat October 14, 2013 16:39

Hi Andrea,

Have a look into the tutorials listed here: http://openfoamwiki.net/index.php/Sn...als_and_Guides

Best regards,
Bruno

c0sk October 19, 2013 17:25

4 Attachment(s)
I went trough those but we no success. Same result, no visible mesh.
I also tried using HelyxOS:
1)created new case
2) Left base mesh settings unchanged
3) in the volume option i did import .stl and imported my stl
Tried both outside and inside but it says it is not supported (cause the geometry might not be closed??)
4) Proceeded to write the mesh.
5) I can see only the box, there is clearly something wrong with my execution of snappy but, due to my limited knowledge, I have no idea.
6) I also tried with a sphere and got nothing as well, so it is me.

Did I miss any step? I left the levels of refinement unchanged cause it did not let me do neither inside or outside (with the sphere I can see that the box gets refined but cant see any sphere inside).
I attached some picture which also show the hummingbird.stl inside the searchable box.
Apologies :(:(
Andrea

wyldckat October 20, 2013 03:26

Hi Andrea,

The quickest way to check if the problem is with the STL file is to run this command:
Code:

surfaceCheck hummingbird.stl
Beyond this, I suggest:
  1. Create a much simpler version of your hummingbird, perhaps a pyramid or 3 pyramids, and start working with that. This way it's a lot easier to diagnose a lot of things.
  2. If you want, you can upload your model "hummingbird.stl" to a DropBox account or similar and share the link to it via "Private Message" with me. I can have a quick look into it, to ascertain what could be wrong with it. But still, this does not discard the need to do the first suggestion!
Best regards,
Bruno

c0sk October 25, 2013 18:26

Sorted thanks, I realised I was just being an idiot and messed up with the inside/outside refinement boxes etc. I got the geometry in now and I will start soon. :D:D
By the way, why if I interrupt a solver while is running from HelyxOs then is compromised and wont run a second time? :mad:

Regards

Andrea

wyldckat October 26, 2013 05:54

Hi Andrea,

Quote:

Originally Posted by c0sk (Post 459051)
By the way, why if I interrupt a solver while is running from HelyxOs then is compromised and wont run a second time? :mad:

Please report this on HelyxOS' bug tracker: http://sourceforge.net/p/helyx-os/tickets/
And please detail for them the specific steps you take, so that they can reproduce the error! ;)

Best regards,
Bruno

c0sk December 11, 2013 18:55

Dear Bruno,
I am getting along fairly well!!
However, now the meshes are getting coarser and my machine cannot handle them any more. Consequently, I got access to the University HPC. The cluster has OpenFoam installed but sadly no extension! My supervisor said that we can get the solver and the function installed somehow. Now, is there any way in which I can simply compile the function before every simulation or do I have to install it before? Is it the same for the solver? I need icoDyMFoam and RBFMotion Funtion. What would you recommend? Thanks!!! :D:D
Regards
Andrea

wyldckat December 15, 2013 12:10

Hi Andrea,

Quote:

Originally Posted by c0sk (Post 466031)
I am getting along fairly well!!

Good to know!

Quote:

Originally Posted by c0sk (Post 466031)
However, now the meshes are getting coarser and my machine cannot handle them any more.

Mmm... you do mean that the meshes are getting more refined? Because the finer the mesh, the more cells there are and therefore more memory and CPU power is necessary.
"Coarser" means that there are a lesser number of cells and therefore less precision in the discretization ;) Hence "coarser".

Quote:

Originally Posted by c0sk (Post 466031)
Consequently, I got access to the University HPC. The cluster has OpenFoam installed but sadly no extension!

:confused: Do you mean that it does not have 1.6-ext?

Quote:

Originally Posted by c0sk (Post 466031)
My supervisor said that we can get the solver and the function installed somehow. Now, is there any way in which I can simply compile the function before every simulation or do I have to install it before? Is it the same for the solver? I need icoDyMFoam and RBFMotion Funtion. What would you recommend?

If you are using 1.6-ext on your computer and the HPC cluster does not have it installed, that's a big problem. I haven't checked but at least "RBFMotion" function might be complicated to port to OpenFOAM 2.x.
In theory, it's just a matter of similarly following the steps from chapter 2 on this tutorial: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam

Which specific version(s) of OpenFOAM do they have on their cluster? I can try to have a look into this next weekend.

Best regards,
Bruno

c0sk February 2, 2014 12:18

1 Attachment(s)
Quote:

Originally Posted by wyldckat (Post 466523)
Hi Andrea,


Good to know!


Mmm... you do mean that the meshes are getting more refined? Because the finer the mesh, the more cells there are and therefore more memory and CPU power is necessary.
"Coarser" means that there are a lesser number of cells and therefore less precision in the discretization ;) Hence "coarser".


:confused: Do you mean that it does not have 1.6-ext?


If you are using 1.6-ext on your computer and the HPC cluster does not have it installed, that's a big problem. I haven't checked but at least "RBFMotion" function might be complicated to port to OpenFOAM 2.x.
In theory, it's just a matter of similarly following the steps from chapter 2 on this tutorial: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam

Which specific version(s) of OpenFOAM do they have on their cluster? I can try to have a look into this next weekend.

Best regards,
Bruno

Ahahah yeah I did mean refined. Sorry! That issue has been solved and the extension version of openFoam is now installed on the cluster.

However, I did encounter a major issue. As showed in the picture, the plate is moving as it should and it did work fine on the modified geometry of the movingblockRBF case. However, I had to enlarge the domain and reduce the dimension of the block. I am using the same kinematic model I tested on the tutorial but after approx .2 seconds (62000 cells, approx 3 minutes after starting) of simulation, it crashes since the velocity goes to an outrageous order of magnitude (10^34 etc). My hypothesis is that since the mesh gets to squashed I get numerical errors. I noticed that by modifying some parameters in the dynamic mesh dict I can delay the problem but i can stop it. Do you know where I can find some tips on how to avoid this? Thanks!! :confused::confused:

wyldckat February 2, 2014 12:27

Hi Andrea,

I think the problem is because the cells are getting extremely compressed on the right side of the mesh. You need to increase the region through which the mesh can expand, so that it can distribute the cell compression along the cells to its right.

Problem is that I'm not familiar with this specific mesh motion, so I don't know which parameters need tuning :(

Can you share the contents of the file "constant/dynamicMeshDict"? And indicate which parameters you've been changing?

Best regards,
Bruno

c0sk February 2, 2014 12:31

Dear Bruno, Thanks for the quick reply!!
Here is my dict
Code:

dynamicFvMesh dynamicMotionSolverFvMesh;

solver RBFMotionSolver;

movingPatches ( block );

staticPatches ( left right top bottom );

coarseningRatio 5;

includeStaticPatches  no;
frozenInterpolation    yes;

interpolation
{
    RBF  IMQB;
    focalPoint (0 0 0);
    innerRadius 1;//5.0
    outerRadius 1.5; //12;
    polynomials true;

    W2Coeffs
    {
        radius    4;
    }
    TPSCoeffs
    {
        radius    5;//5;
    }
    GaussCoeffs
    {
        radius    5; //0.1;
    }
    IMQBCoeffs
    {
        radius    0.01;//0.001;
    }
}

I have been changing the values where there is a comment. The comments show the original value.

wyldckat February 2, 2014 13:29

Hi Andrea,

The two most suspicious parameters are:
Code:

outerRadius 1.5;
I believe you should increase that value.

Code:

    IMQBCoeffs
    {
        radius    0.01;//0.001;
    }

This is the entry associated to "RBF IMQB;", therefore the other ones above ("W2Coeffs" and so on) are likely not used. And I think you should also increase this value considerably more, perhaps up to 0.1 or 0.5.

But as I said, I'm not familiar with this dynamic mesh motion, so this is just an educated guess :).

Best regards,
Bruno


All times are GMT -4. The time now is 09:17.