CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Mosquito Analysis in OpenFoam (https://www.cfd-online.com/Forums/openfoam/119580-mosquito-analysis-openfoam.html)

psk June 20, 2013 03:11

Mosquito Analysis in OpenFoam
 
Greetings OF friends,

I am trying to do cfd analysis in mosquito model, by using cameras we capture frame by frames and extract the coordinates (X Y Z) of model.

One Wing Beat = 10 frames. Each frame we have the coordinates of model.I am trying to understand the physics and to find lift & drag.

I have only little experience in open foam. I did tutorial problems from that I understand how to use and I hope I get enough confident.

Generally, it covers unsteady, Dynamic & moving mesh,Fluid solid Interaction.

The problem is I don't have STL file format, I have only coordinates.What i have to do, How i can start with these coordinates, whether i have to write any script file to import? I install OF 2.1 kindly secure and guide me.


Many Regards,
david

Bernhard June 20, 2013 07:56

I am unsure what your problem is. Is the main issue to convert coordinates to STL? Google supplied me with this script: http://www.mathworks.com/matlabcentr...l-surface-mesh

elvis June 20, 2013 08:56

Hi,

I remember that Frank Bos developed Radial Basis Function (RBF) with Insect flight in mind

http://ftp.jaist.ac.jp/pub/sourcefor...h/frankBos.pdf
Moving and deforming meshes for flapping flight at low Reynolds numbers

You find Radial Basis Function (RBF) included with Open FOAM 1.6-extend
Warning you will not find Radial Basis Function (RBF) included on a non EXTEND-Version of OpenFOAM!. So if you want to use GGI of RBF or Block Coupled Matrix Solver or Finite Area Method (FAM) you have to use OF-1.6-EXTEND-Version

The PHD-Thesis from Frank Bos is also available online
http://repository.tudelft.nl/assets/...daa1b2/bos.pdf (size 11MB)

psk June 20, 2013 09:08

1 Attachment(s)
Hai Bernhard, thanks for coming to help me. My interest is flapping & flexible wing MAV.I will tell you step by step what I did.


·My goal is to find lift for flexible flapping model of my wing (see the Image).



·For that what i did is, I fabricate the wing and I initially consider 5 points on the wing (1, 2, 3, 4, 5) by using fluorescent ink to mark the points on the wing.


·By using the camera I capture the wing movement by frame by frame. Camera captures 100 frames per second. One complete wing beat it takes 10 frames. See the link [ http://www.unc.edu/~thedrick/software1.html]. I am

following the same procedure of Hedrick lab what they did. Please see the link.


·From the digitilization, I extract the XYZ coordinates of my wing by frame by frame. Afterwards I go for mat lab to plot the XYZ coordinates to see the replication my wing.



From the mat lab how I can incorporate open foam to find the lift of wing and how I start with Pre-Processing (Meshing)?




Many thanks,
David

psk June 20, 2013 09:30

HAI ELVIS,

Thanks for coming to help me,Please see my above post what i did up to right now. currently I have mat lab file, I don't know how to incorporate Open Foam with mat lab for Meshing,kindly give your feedback.


Many thanks,
david

elvis June 20, 2013 10:28

Hi David,

i am not an expert on that topic. I just knew that OF was used for insect wing CFD.
And that RBF was implemented to handle mesh deformation as comfortable as possible for such a tricky application.

If RBF is the right mesh motion technigue you want to use for your simulation, I guess that the marker dot you filmed and extracted with mat lab are the stearing points for RBF to do mesh deformation. I do not know what the best tool to do meshing

psk June 20, 2013 12:29

Meshing Mosquito in Openfoam
 
Thanks elvis,Correct I extract the xyz coordinates by using digitizing [ DLTdv5 MATLAB code].

I am looking for only meshing part not solving, first thing I have to mesh properly.I don't know how to start in open foam for meshing.Anybody have idea/suggestions kindly help me.


Many Thanks
David


elvis June 20, 2013 14:40

Dear David,

I would start to get OF1.6-ext installed! If RBF is the tool you want to use for your simulation. You are lucky OF1.6-extend is back online I would study the RBF tutorials that are added, and when you came to that point, I would watch out for which tool is the right Meshingsoftware

psk June 21, 2013 02:21

Meshing Mosquito in Openfoam
 
Hai elvis, thanks for coming again,

I go through Frank Bos post in OF forum, I think he used OF 1.2 & OF 1.3 [
icoFoamAutoMotion and interFoam] and I thought,finally he goes OF 1.6 ext.I hope OF 1.2, OF 1.3 and OF 1.6 ext may be help this problem.But I concentrate only on meshing part,I am totally confused about Pre- processing of OF which one is useful for this kind of problem. I don't exactly but still I am searching for good meshing software.

For my problem I have to use any one of the following Meshing.

1.Moving
mesh
2.Dynamic mesh
3.ALE mesh
4.Arbitrary mesh interface


Kindly give your feedback.

Many Thanks,
david

elvis June 21, 2013 05:44

Hi David,

if I remember correctly RBF was introduced with OF-1.5-dev and it was transfered to latest "community Version" called OF1.6-extend. So you do have the choice to use OF1.5-dev or OF1.6-extend => I would try the supported Version 1.6-extend.

To tell you a little bit about dynamic mesh handling ;-)
Arbitrary mesh interface (AMI) is a mesh technology that was introduced with OpenFOAM® v2.1.0:
Arbitrary Mesh Interface (AMI) it is "OpenCFD Ltd´s" "answer" to the Generalized Grid Interface (GGI) mesh technology that was introduced by Hrv Jasak and Martin Beaudoin in OF1.5-dev & OF1.6-extend

You find s.th similar http://www.openfoam.org/version2.0.0/surface-film.php and (Finite Area Method (FAM)
http://www.cfd-online.com/Forums/ope...ilm-model.html

http://powerlab.fsb.hr/ped/kturbo/Op...Manuscript.pdf
I would suggest explore http://powerlab.fsb.hr/ped/kturbo/OpenFOAM/ folder papers & docs

psk June 21, 2013 10:02

Thanks a lot elvis for your kind help & information,

It takes time for me to read and get some idea.Keep in touch


Many thanks,
David

elvis June 21, 2013 12:35

Hi David,

I think tutorial flappingConsoleSmall is what you should try
/OpenFOAM/OpenFOAM-1.6-ext/tutorials/stressAnalysis/icoFsiFoam/flappingConsoleSmall

psk June 21, 2013 12:57

Hai elvis thanks for kind information.

Currently I am go through OF 1.6 ext what you mention earlier post, For meshing I thought there is no need to go in-depth of Open Foam. Instead of that, may be use some structural stuff meshing software for meshing. In case meshing is tough in open Foam.

For solving part to use Open Foam,Please give your feedback about my idea, whether its correct or wrong approach?

Many Thanks,
David

psk June 24, 2013 08:55

icoDyMFoam error
 
Hai friends,
I install open foam 1.6 ext in Ubuntu 12.04 LTS I try to run icoDyMFoam tutorials it shows error like this,

Case : /home/david/OpenFOAM/OpenFOAM-1.6-ext/tutorials/incompressible/icoDyMFoam/movingBlockRBF
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Creating block mesh from
"/home/david/OpenFOAM/OpenFOAM-1.6-ext/tutorials/incompressible/icoDyMFoam/movingBlockRBF/constant/polyMesh/blockMeshDict"
Creating curved edges
Creating topology blocks
Creating topology patches

Reading patches section

Creating block mesh topology

Reading physicalType from existing boundary file

Default patch type set to empty
--> FOAM Warning :
From function blockMesh::createTopology(IOdictionary&)
in file blockMesh/blockMeshTopology.C at line 517
Reading "/home/david/OpenFOAM/OpenFOAM-1.6-ext/tutorials/incompressible/icoDyMFoam/movingBlockRBF/constant/polyMesh/blockMeshDict" from line 17 to line 150
For patch top overriding type 'patch' with 'wall' (read from boundary file)

Check topology

Basic statistics
Number of internal faces : 8
Number of boundary faces : 32
Number of defined boundary faces : 32
Number of undefined boundary faces : 0
Checking patch -> block consistency

Creating block offsets
Creating merge list .

Creating polyMesh from blockMesh
Creating patches
Creating cells
Creating points with scale 1

Writing polyMesh
----------------
Mesh Information
----------------
boundingBox: (-12.5 -12.5 -0.1) (12.5 12.5 0.1)
nPoints: 1352
nCells: 620
nFaces: 2536
nInternalFaces: 1184
----------------
Patches
----------------
patch 0 (start: 1184 size: 12) name: block
patch 1 (start: 1196 size: 25) name: top
patch 2 (start: 1221 size: 25) name: bottom
patch 3 (start: 1246 size: 25) name: left
patch 4 (start: 1271 size: 25) name: right
patch 5 (start: 1296 size: 1240) name: frontAndBack

End

david@ubuntu:~/OpenFOAM/OpenFOAM-1.6-ext/tutorials/incompressible/icoDyMFoam/movingBlockRBF$ icoDyMFoam
icoDyMFoam: command not found
david@ubuntu:~/OpenFOAM/OpenFOAM-1.6-ext/tutorials/incompressible/icoDyMFoam/movingBlockRBF$


Kindly guide me


Many Thanks,
david

elvis June 24, 2013 14:55

Dear David,

did you follow http://openfoamwiki.net/index.php/In...1.6-ext/Ubuntu ? in thread http://www.cfd-online.com/Forums/ope...ll-errors.html there used to be a link to Martin Beaudoin OF-Ext Install Guideline that is not existing anymore.

I would suggest to try a live DVD-Image http://rcc.its.psu.edu/ofw6/ofw6_v8.iso from 6th OF Workshop to have a 100% working Extend-version

wyldckat June 24, 2013 16:50

Greetings to all!

@elvis:
Quote:

Originally Posted by elvis (Post 435661)
did you follow http://openfoamwiki.net/index.php/In...1.6-ext/Ubuntu ? in thread http://www.cfd-online.com/Forums/ope...ll-errors.html there used to be a link to Martin Beaudoin OF-Ext Install Guideline that is not existing anymore.

:confused: In the section "2.3 Ubuntu 12.04" at http://openfoamwiki.net/index.php/In...u#Ubuntu_12.04 , it gives the links to 3 copies of Martin Beaudoin's guides on how to install OpenFOAM 1.6-ext on Ubuntu 12.04! ;)

Best regards,
Bruno

psk June 25, 2013 10:36

Thanks elvis and wyldckat


regards,
david

immortality June 25, 2013 14:38

Hi psk
is the usage of mosquite in optimization of geometry or only for moving mesh?
and whats its difference from Dakota if it can be used for geometry optimization?

psk June 26, 2013 01:40

Thanks for your kind response immortality, its only Moving mesh / Dynamic mesh.

I didn't understand [whats its difference from Dakota if it can be used for geometry optimization] what it means , If you don't mind kindly let me know.

kindly go through my post if you have any idea, let me know. As per elvis and other OF friends instructions i am working in Open Foam 1.6 ext.

many thanks,
david

psk July 11, 2013 14:26

Good Morning folks and elvis, this is david , last two weeks i struck with my personal commitments, I install OF 1.6 and i run IcoDyMFoam it works fine.

Before start my work, I would like to start with rigid flat wing with flapping amplitude of -10 to + 10

Mosquito wing- FSI problem, I thought its little complicated, Initially i would like to start with rigid then go for flexible.

If you have any tutorials related rigid flat wing,kindly let me know

How I can Proceed?

Many Thanks,
david

Artur July 12, 2013 05:08

Have you sorted out your .stl file generation problem? I think you will need to get that out of the way before you proceed further. I have a python program which generates (x,y,z) data and then uses it to create an .stl file. I use it to make cylinders for shafts and cylindrical domains but you could rewrite it to put in your wing geometry and get a solid representation of it. Let me know if you want it.

Optionally, if you have access to Rhinoceros, you can put your set of points into it and then fit surfaces through the data which will also do the trick (I've done it a few times for ship hulls so I'm pretty sure it would work for your geometry too).

Unfortunately I have no experience with flapping geometries or FSI so that's the only help I can offer I'm afraid.

psk July 12, 2013 14:26

Thanks artur for your kind information and coming forward, Exactly correct what you mentioned.

currently I am learning python software, I try to write script file for this, kindly send me your python program.

I have no experience on Rhinoceros, anyhow i try to learn it.

Many Thanks,
david

elvis July 16, 2013 13:20

Hi David,

what software do you want to use for preprocessing?
From your post I assume that you generate a STL-file from your video's with the help of matlab. But which software will generate the mesh?

I can tell you that engrid should be capable to write out the File-structure needed for FSI (as Oliver Gloth implemeted "conjugate heat transfer" https://github.com/enGits/engrid/wik...heat-exchanger) but engrid has few documentation so far.

I loaded the flapping console example into engrid (solid and fluid seperately)

wyldckat July 16, 2013 16:48

Greetings to all!

@David: If you're comfortable with Python and want to generate the geometry parametrically and/or with points, I suggest you give PythonOCC a try: http://www.pythonocc.org/
AFAIK, you can then export the resulting geometry to the format best suited to the mesh generator you choose.

Best regards,
Bruno

psk July 17, 2013 02:58

1 Attachment(s)
@ Good Day elvis, I have xyz coordinates of each frame,[Totally 10 frame]

I am not looking to create STL format, it doesn't make any sense because wing become rigid, for my case its flapping flexible wing. In case wing is rigid what ever you are telling is exactly correct, and I am not interest on that, because its a quasi steady analysis. You have to create STL format for each frame then you have to do analysis. Totally 10 STL geometry.

First frame Image: (Totally six points) If I import these xyz coordinates I get my geometry, but wing become rigid if you write UDF for this its ok ( some people did in fluent for writing UDF their rigid wing: see this link:
[ https://www.youtube.com/watch?v=s_gtukpyHXk ]. In this you tube video, I think they are using sinusoidal equation to flap the wing up & down, In that wing there is no flexibility its simply move down and change their orientation to 90 deg then move up.

Kindly see this you tube link for difference between Flapping Flexible wing vs Flapping Rigid wing.

Flapping Flexible wing -----> [ http://www.youtube.com/watch?v=-xU8p5gPfn8 ]
Flapping Rigid wing---------> [ https://www.youtube.com/watch?v=s_gtukpyHXk ] & [ http://www.youtube.com/watch?v=t8m5ApeRbV8]

please compare these two video, you can get better idea.I fabricate my wing with Mylar sheet its looking like a paper with negligible thickness, its has some flexible deformation. According to my knowldege its only way to write script file by using the xyz coordinates and see the mesh with similar to this video --->[ https://www.youtube.com/watch?v=s_gtukpyHXk ].

I plot my data in matlab, I go through engrid and Blender its really good, It seems I have to write script for this. Is there any possibility without writing script file to import the coordinates to do this work ? I hope you understand my problem.kindly secure and help me.

Million Thanks,
DAvid



@GoodDay wyldckat,

I hope PythonOCC to help my problem. I have very less experience in python. That why I plot my data in mat lab to incorporate with open foam and also see my flapping flexible wing in you tube ----> [ http://www.youtube.com/watch?v=VehX7Q1p6jY ]

1) Is there is any possibility to incorporate the mat lab script to Open Foam for meshing?
2) Is there is any possible to convert mat lab script to Python script then to go for openfoam /any other software for doing mesh?
3) Is there any possibility without writing script file to import the coordinates to this work ?
4) Other than 1 2,& 3 this there is any better idea according to you? PythonOCC seems to be helpful I think so.

Kindly see the you tube link above for difference between Flapping Flexible wing vs Flapping Rigid wing

I install PythonOCC, currently I am learning python, kindly secure and help me, what I have to do by using the xyz coordinates? how I can get moving mesh with similar to Flapping Rigid wing?


Million Thanks,
DAvid

psk July 18, 2013 22:18

Good Day folks,

Kindly see my above post, its quite interesting & challenging task. Anybody have an idea and suggestion about my problem you are welcome.I am looking for guidance to travel in right path, before I start my problem.

Million Thanks,
David

wyldckat July 21, 2013 15:10

Hi David,

It took me a while to read through the whole thread and to have a look into the tutorials that people mentioned. Therefore, I'll sum up the conclusions I've gathered so far:
  1. The tutorial "incompressible/icoDyMFoam/movingBlockRBF" from OpenFOAM 1.6-ext will be useful for when you have more complex motions, namely when the wings begin to twist.
    • A small note in this case: I had to generate the mesh with OpenFOAM 2.2, because 1.6-ext complained with me about:
      Code:

      --> FOAM FATAL ERROR:
      Inconsistent point locations between block pair 3 and 4
          probably due to inconsistent grading.

          From function blockMesh::createMergeList()
          in file createMergeList.C at line 274.

      but it could be due to the version I've got built...
  2. pythonOCC will only be able to help you in this case, if you have to generate very complex and parametric wings. If your wings are to be always without thickness, then pythonOCC is overkill.
  3. There are a few ways I can think of that you can generate the mesh for this case, always thinking of the initial points only, but it can strongly depend on the level of complexity of your wing:
    1. If your wing is just 6 fixed points with stretched wings at the start of the simulation and any flexibility only appears during simulation, then here are in summary the ways I can think of:
      1. "Strict point manipulation" - You can generate a base mesh that has got the 6 points aligned in the same plane, as if they were drawing two rectangles. Then distort the mesh to place the points at the starting position, along with the remaining mesh.
      2. "Directly drawn wing in mesh" - Basically this means that you would have to generate a "blockMeshDict" file with MATLAB or Python. Or you could even code it using the same technique as shown in the tutorial "basic/potentialFoam/cylinder", in the file "constant/polyMesh/blockMeshDict", as demonstrated since OpenFOAM 2.0.0 up to 2.2.x. In this tutorial, the points for the cylinder are strictly calculated directly in the "blockMeshDict" file. But the organization of the blocks themselves is fixed.
    2. If your wing can start in a more complex shape, then it requires you to either:
      1. Have a fully parametric definition of the wing, so that it can be discretized with greater accuracy.
      2. Or if you already have got all of the necessary points for the surface, then you'll need to get all of the points to the mesh efficiently.
      Either way, STL is most likely the way to go, but you could also try a more complex version of the ideas on "point 3.1".
      If you rely on an STL form for the initial shape, you'll need to either use snappyHexMesh, enGrid, NETGEN or any other mesher that can handle STL geometries.
  4. Once you've got the initial points in place, there are several ways you can keep track and/or move those points. Some ideas:
    1. You can use swak4Foam (namely groovyBC that it provides) for manipulating the positions of the points directly, without needing to code. The positions will then have to be placed in a CSV formated file or similar, for the points to be read into the boundary condition of point displacement.
      The limitation here might be due to being unable to allow the wing to be flexible.
    2. You can use one of OpenFOAM's own boundary conditions for point displacement, but this is likely not going to allow flexibility, although I'm not familiar enough with these boundary conditions.
    3. The ultimate case will be to have to code your own point motion boundary condition in C++, based on one of OpenFOAM's point motion boundary conditions.
OK, many ideas, but where could you start? My suggestion is to:
  1. Start really simple, namely to focus on simulating only one of the 2 parts of the wing, and to mesh only the area above that part or below it.
  2. Then learn how you can create a baffle.
  3. Learn how you can manipulate the baffle, the same as you did in point 1. This will allow you to have mesh both below and above.
  4. Increase mesh resolution on this part wing (now a baffle), in order to add more complexity. Try some stuff in an attempt to shape this part of the wing, either by force or by simply displacing the points.
  5. Add the second part of the wing. Play with it as you did in 4.
  6. Now try to extend the mesh beyond the wind zone, by not just having mesh above and below it.
  7. When the time comes... well... it's fully fledged point manipulation time!?
I can suggest a simple test case with which you can start for the step #1 of this last list: http://www.cfd-online.com/Forums/ope...tml#post394044
If you run the example case (it only moves the mesh) and see it in ParaView, you should be able to understand what I mean by this first step. In addition, if you look at the "constant/polyMesh/blockMeshDict" file, you should be able to see the 4 corner points of the box that you can change for the corresponding mesh side to one part of your wing.

Best regards,
Bruno

psk July 23, 2013 06:51

Good Day and many many thanks for kind reply and brief information wyldckat.

I hope "point 3.1" idea is more suitable for this problem. I already did small program in Matlab but i don't know how to generate blockMeshDict with Matlab. I go through mat lab & Google & other post in OF, but i didn't get any idea how to generate, kindly let me how to generate?

In addition I am editing "constant/polyMesh/blockMeshDict" also.

elvis July 23, 2013 08:14

Dear David,

I do not know how well this works (Matlab->Blender)
http://blenderartists.org/forum/show...ort-in-Blender

from Blender I have in mind that you can inport into a) Engrid => OF-mesh (my favorite way) keep in mind https://github.com/enGits/engrid/wik...heat-exchanger that is close to a "FSI OF-mesh"
or b) at least use "SwiftBlock" http://openfoamwiki.net/index.php/Contrib/SwiftBlock
a Blender->Blockmesh script or c) http://openfoamwiki.net/index.php/Contrib/SwiftSnap

http://openfoam-extend.sourceforge.n...tadt/OFW7.html
Blender 3D as a GUI for OpenFOAM's native mesh generation tools; K.-J. Nogenmyr
unfortunately no slides from that presentation

psk July 24, 2013 14:40

@Good Day Elvis,

Thanks for reply and kind information,currently i am learning blender, Engrid and python.I did small program in Matlab and I consider only 3 points for simplicity. kindly see the attached document.

And also I make matlab to python script file(might be some mistake), then i import python script to blender through text editor once click the Run Script, it shows some error like python script fail, look in the console for now , i didn't understand what it mean I am new to blender, I hope from blender ---> to make blockMeshDict file is possible.Kindly help me how to make blockMeshDict file, I am struggling.

Million Thanks,
david




@Good Day wyldckat,

I go through gradually opening wall (thanks for uploading) & cylinder tutorial its really nice.

And I did two types of edit at blockMeshDict file in cylinder, (I consider only 3 points for simplicity) please see attached csv file & edited blockMeshDictone & blockMeshDictsecond file, and I hope, I have to make some changes in that file, Kindly help me to make blockMeshDict file and also see my matlab & python script for your kind persual.


Apart from this I am following your suggestion step by step, I am editing the blockMeshDict file(gradually opening wall case) I will upload very soon for your feedback

wyldckat August 18, 2013 08:02

Greetings to all!

@David: I've been very busy the past few weeks and didn't manage to even login here on the forum. And from what I've seen, you've been very busy trying to figure out how to solve the problem at hand.

After pruning through all of your posts since the one above, here is a collection of the related threads that survived the pruning and that I'll try to answer to some of them in the next few hours:
Best regards,
Bruno

psk August 19, 2013 04:29

Good Day Bruno,

I hope you fine, Many Thanks for coming.

maalan September 24, 2014 15:09

Hi there!!

Could anyone share this paper?

Lentink, D & Gerritsma, MI (2003). Influence of Airfoil Shape on Performance in Insect Flight (AIAA-2003-3447). In 33rd AIAA Fluid Dynamics Conference and Exhibit, Orlando, Florida (pp. 1-17). AIAA.

Thank you very much!


All times are GMT -4. The time now is 07:05.