PDA

View Full Version : Modeling a wind turbine blade from external data + later animation



santasemilla
03-Oct-11, 12:01
Hi all,

I'm just joining the community and I have a project I want to do for my PhD thesis. My research field is wind turbine blades and I'm studing fluid-structure interaction. Since a couple of days I'm trying to get information and ideas on how to start the post-processing of all the data I have into a nice animation and I thought Blender+Python would be a powerful combination. Yes yes yes, before you say it, I'll say it: I'm reading and watching basic tutorials as well as trying to get information on basic python scripting. but as you know, there are so many things out there to learn that I decided to ask for some help and guidance as I have limited time to be able to get this working and at the same time finishing many other things on my dissertation. As they say, a good way to learn is when you have limited time and things to get done! haha.

Well, I'll describe a picture of what I have:

I model my blade from standard airfoil sections at certain spans. In between the spans, the airfoil sections are morphed. I'm doing all this with Matlab as later I'm using the crossections to assign materials, internal structure distributions and finally compute rigidity and inertia matrices using finite elements methods (no standard codes, all custom codes under Matlab). Once I have my blade, I also coded a flow dynamic model which will give me aerodynamic forces for my structural model. Long story short, among many other things, I end up having 3 displacements + 3 rotations for every blade section along the blade axis along a time simulation.

Ok, but what do you need to do? (you would ask) :

- I can export every single blade section on a text file with (X Y Z) coordinates. Don't worry about the internal structures, just the skin of the blade is fine. Yes, all sections with the same amount of nodes to later do the following...

-I should be able to load (and this is when python coding enters the picture) the coordinates into Blender and position them. After that, I should be able to do something like this: Blender Skinning (http://www.blender.org/documentation/htmlI/x4135.html). (Can I also automatize this by coding? ..mmm sure I can, I guess)

-Next step would be loading a reference line (blade axis) which has multiple nodes. This reference line should be like a "spine" where every "vertebra" is a node.

-Finally, I should input the 3 displacements and 3 rotations for every node on that reference line for every time-step to be able to animate my simulation results from Matlab. (Yes, I can hear you, bone simulation!)

Well.. that' s all. As you see, I have an idea of what I need to do, but as I'm totally new to this world, I'm looking for help as I don't know where to start! I would really appreciate any kind of help you could give me. Any tip, any reference tutorial link, python script would be welcome!

Thank you very much for your time and help and I'm looking forward to learn new things and being able in the future to help others too!

Thanks Again.

daren
03-Oct-11, 12:24
Have you seen these tutorials, they show how to use Python to create an object, as well as (Part 2) export mesh data into a text file.

That might solve one problem...

http://cgcookie.com/blender/2011/03/28/creating-a-mesh-from-python-data-part-01/

PS -- what are you getting a PhD in? Sounds like fluid dynamics or physics...
I am a PhD candidate in Electrical Engineering here...and probably should be studying.

RickyBlender
03-Oct-11, 12:27
first go to python forum for any scripts ideas!

1- reading data file
give us the Ascii format for the data

2 -
sorry but for the spine and nodes i don't understand what you mean here
can you make a diagram showing this if possible or give an example

are you talking like frame on a video sequence?




are you going to use some external program to do you flow analysis or make your own math model inside blender?

have fun

santasemilla
03-Oct-11, 13:07
Have you seen these tutorials, they show how to use Python to create an object, as well as (Part 2) export mesh data into a text file.

That might solve one problem...

http://cgcookie.com/blender/2011/03/28/creating-a-mesh-from-python-data-part-01/

PS -- what are you getting a PhD in? Sounds like fluid dynamics or physics...
I am a PhD candidate in Electrical Engineering here...and probably should be studying.

Hi Daren,

I'll put it in my list. I started with the Introduction to Scripting in Python in Blender (http://cgcookie.com/blender/2011/08/26/introduction-to-scripting-with-python-in-blender/). But I'll have a look for sure! What I need to do is to import data into blender (the airfoil coordinates) I don't know if the video would help, but it will definitely give me an idea on how things work for sure! Thanks!

I'm doing a Ph in Mechanical Engineering. yes, working with fluids, structural analysis, finite elements, etc. ;)

Thanks a lot again Daren!

santasemilla
03-Oct-11, 13:43
first go to python forum for any scripts ideas!

1- reading data file
give us the Ascii format for the data

2 -
sorry but for the spine and nodes i don't understand what you mean here
can you make a diagram showing this if possible or give an example

are you talking like frame on a video sequence?




are you going to use some external program to do you flow analysis or make your own math model inside blender?

have fun

Hi Ricky,

Yeah, I doubted to post here or in python section, but as my question was general to modeling.. I started here. I'm looking also into the python forum, thanks!

For 1): I can easily output a .dat file from Matlab. this file contains text separated with a space, tab and I think I could do comma too. It would look something like this:


Blade NREL5MW intermediate airfoil # 0026 @ 0.7717
99.9964169 0.1593491
99.5968741 0.2654285
99.1973315 0.3715086
98.7977888 0.4775887
98.3982449 0.5836638
97.9986992 0.6897326
97.5991468 0.7957760
97.1995735 0.9017405
96.7999692 1.0075881
96.4003275 1.1132943
96.0006290 1.2187855
95.6008463 1.3239574
95.2009588 1.4287299
94.8009508 1.5330415
94.4008165 1.6368674
94.0005792 1.7402957
93.6002690 1.8434413
93.1999099 1.9463972
92.7995231 2.0492450
92.3991258 2.1520524
91.9987307 2.2548682
...
...
Those are just (X Y) data, but they could easily be (X Y Z).

For 2):

Sorry, I'll try to put an example and later try to sketch something in paper at least to scan it and attach it here to the thread. Imagine that you need to animate a character, a guy dancing. you have the upper skeleton. You have the ribs and you have the spine. You will input data for the animation as displacements and rotations at every vertebra. Yes, you will input a bunch of data for every time-frame in the animation. As a result, the ribs will then displace and rotate (if they are rigidly connected with the spine). Ok, now from the metaphor (?) :confused: to reality: The "ribs" are going to be the airfoil crossections (as the boat sections in the skinning example (http://www.blender.org/documentation/htmlI/x4135.html)).

156627

The "spine" is the imaginary axis which aligns all the crossections. Just like if you assign a node for every "Z" position in the reference line where you have a curve in the above figure.

Don't worry about the simulations results, those are already done and the only thing I need to do here is to "animate" the blade according to those displacements and rotations I mentioned for a time-line I also have already defined. This data would also need to be imported to blender... but if I get the way to import coordinates for the crossections.. I can use the same technique to import the data for the animation.

As you see, this is a two part project. First, get the blade model and that "reference line" into Blender. Second, input the needed data for the animation.


Thanks a lot for your help Ricky! I hope to be more clear now.

RickyBlender
03-Oct-11, 14:30
i see it should be easy to read this data

i'll see if i can find a script to read this ascii data somewhere on my disk!

and be back soon


are you on windows ?

and what maximum number of data lines here ?
i assume you read lines and add these to an array here

RickyBlender
03-Oct-11, 15:32
ok here is a quick modified script that i had
you can modify it to suit your own datas

and it will read your lines as shown earlier


don't forget to modify the path to the file and filename






import bpy, math

from bpy.props import *
from mathutils import *
from math import *


import re
import string


nvert1=0
oldlat=0.0
lat1=12.15577


vertsData, edgesData, facesData=[],[],[]



print ()

# C:\Users\RJ\0blend25\0basciprogram1\stlaurent1\fil estlaur1

fo=open('C:\\Users\\RJ\\0blend25\\0basciprogram1\\ stlaurent1\\filestlaur1\\data1.txt','r')


points = []
linedata=[]
kk=0

print ()

p1 = re.compile('(-|N|W)')


l1=0
linenum=[]

data=[]

####


for line in fo.readlines():


# print ('l1=',l1,'line =',line)

nval=[]
# print ('l1',l1,'kk=',kk)

if kk > 0: # Skip first line

linedata.append(line)


# print ('linedata [',kk-1,']=',linedata[kk-1])
# print ()

a12=p1.sub( ' ', linedata[kk-1], count=0) # Get rid of spaces

a12split=a12.split()

# print ('a12split=',a12split)

for u1 in range (0,2): # Convert string "00" or "000" to float = 0

if len(a12split[u1])==a12split[u1].count('0') :
nval.append(0.0)
else :
nval.append(eval(a12split[u1].lstrip('0')))

# print ('u1=',u1,'nval=',nval)
# print ()
l1+=1

# nval.append(eval(a12split[u1].lstrip('0')))

# linenum.append(kk)
linenum.append(nval)

print ('linenum [',kk-1,']=',linenum[kk-1])
# print ()


kk+=1


fo.close # Close the file





this gives you an array with float numbers from the files' data



have fun

Witold Jaworski
03-Oct-11, 16:56
...
-Finally, I should input the 3 displacements and 3 rotations for every node on that reference line for every time-step to be able to animate my simulation results from Matlab. (Yes, I can hear you, bone simulation!)
...


If you would have troubles with the bones, you could try to update a lattice modifier in every frame of the film, according this data.
The lattice sections can apply deformations to initially undeformed blade mesh. If your deformation vectors are expressed in the global coordinates, it will be easier to apply them to an lattice, than to the bones. (Bones are better for the relative coordinates).
BTW: are you new to the Python language? Maybe this booklet (http://airplanes3d.net/pydev-000_e.xml)will help you a little in writing Blender scripts, if you know the language basics...

santasemilla
03-Oct-11, 18:00
ok here is a quick modified script that i had
you can modify it to suit your own datas

and it will read your lines as shown earlier


don't forget to modify the path to the file and filename






import bpy, math

from bpy.props import *
from mathutils import *
from math import *


import re
import string


nvert1=0
oldlat=0.0
lat1=12.15577


vertsData, edgesData, facesData=[],[],[]



print ()

# C:\Users\RJ\0blend25\0basciprogram1\stlaurent1\fil estlaur1

fo=open('C:\\Users\\RJ\\0blend25\\0basciprogram1\\ stlaurent1\\filestlaur1\\data1.txt','r')


points = []
linedata=[]
kk=0

print ()

p1 = re.compile('(-|N|W)')


l1=0
linenum=[]

data=[]

####


for line in fo.readlines():


# print ('l1=',l1,'line =',line)

nval=[]
# print ('l1',l1,'kk=',kk)

if kk > 0: # Skip first line

linedata.append(line)


# print ('linedata [',kk-1,']=',linedata[kk-1])
# print ()

a12=p1.sub( ' ', linedata[kk-1], count=0) # Get rid of spaces

a12split=a12.split()

# print ('a12split=',a12split)

for u1 in range (0,2): # Convert string "00" or "000" to float = 0

if len(a12split[u1])==a12split[u1].count('0') :
nval.append(0.0)
else :
nval.append(eval(a12split[u1].lstrip('0')))

# print ('u1=',u1,'nval=',nval)
# print ()
l1+=1

# nval.append(eval(a12split[u1].lstrip('0')))

# linenum.append(kk)
linenum.append(nval)

print ('linenum [',kk-1,']=',linenum[kk-1])
# print ()


kk+=1


fo.close # Close the file





this gives you an array with float numbers from the files' data



have fun


Thank you so much!!! I'll give it a try and let you know later. THANKS!

santasemilla
03-Oct-11, 18:17
If you would have troubles with the bones, you could try to update a lattice modifier in every frame of the film, according this data.
The lattice sections can apply deformations to initially undeformed blade mesh. If your deformation vectors are expressed in the global coordinates, it will be easier to apply them to an lattice, than to the bones. (Bones are better for the relative coordinates).
BTW: are you new to the Python language? Maybe this booklet (http://airplanes3d.net/pydev-000_e.xml)will help you a little in writing Blender scripts, if you know the language basics...

Witold,

...what to say?! I saw your website and I'm impressed. your work is excellent (ha! ...and you call it hobbie!) I'm new to Blender and yes, also to Python. For the few things I've been reading, the general flavor is not so distant to scripting and making functions in Matlab. Your book will come in very handy, thanks so much!

Regarding the lattice modifiers, I don't know if I would be able to use it or not because the rotations of a section, for example, are calculated at the point where the reference line is. What I mean is, the whole cross-section should "pivot" in that point at the reference line. But on the other hand, yes, my displacements and rotations are reported referred to a global coordinate system. I think I should explain with more details my data for the animation, but this has to do more with the mathematical model I'm using than other thing and I don't want to bore people here. If you like, or if this called your attention, I can send you later a PM and tell you more a bout it! Never the less I will dig deeper in a near future to see if I can implement lattice modifiers instead of bones.

Thank you so much for stopping by!

RickyBlender
03-Oct-11, 18:36
not certain here what you gone do with the data!

i mean is each line representing like a location or a rotation may be

for the animation not certain what you mean here function of the data you have in this file !

may be later i'll see what you mean for a prop
i can see the prop shape but are you saying that for each level on the propr it can have a different rotation may be along the main axis

depending on the wind acting on it !

sorry for all questions
but may help later for the animation

RickyBlender
03-Oct-11, 19:02
156677


something like this may be


or completely wrong here !

Witold Jaworski
04-Oct-11, 03:13
RickyBlender, I think you have made right assumption in the post #12. (I think that santasemilla wants to make a visualisation of aeroelastic deformations, but of course it is just m y assumption).



.. I think I should explain with more details my data for the animation, but this has to do more with the mathematical model I'm using than other thing and I don't want to bore people here. If you like, or if this called your attention, I can send you later a PM and tell you more a bout it! Never the less I will dig deeper in a near future to see if I can implement lattice modifiers instead of bones.
...


santasemilla: no problem, you can contact me through the PM. On the other hand, I think that you should not worry about publishing such things in your own thread :eyebrowlift:. There are plenty of other mathemathics here - ligth path algorithms and so - which only a render guru can understand, and nobody complains about it. Many users here are familiar to the language of matrices and vectors!

If Ricky Blender will be so kind to keep helping you, this thread is the easiest way to communicate.... I think that eventual solution may be also useful for the others, who would look at this thread in the future

RickyBlender
04-Oct-11, 09:13
well there is this feature in blender to show stress map

may be this effect can be use here ?

what do you think ?

santasemilla
04-Oct-11, 09:45
Hi RickyBlender, Witold,

Sure! No problem. I will post more about my work so you can understand what I'm doing and what I want to do with Blender. Ricky, your mind is spinning! You are throwing ideas one after the other :D I'm glad you find this project interesting.

I would like to write down some basics on a separate sheet to make sure it makes sense and is is readable. I'll try to do it today.

Thanks both for the interest!

RickyBlender
04-Oct-11, 09:58
see this wili page on stress map which can be done with nodes

http://www.blender.org/development/release-logs/blender-242/material-features/

but depends on data available i guess!


hope it helps

you seems to have an interesting project here!

one question here

is there some web page where you can get the blade shape in 3D to be done in blender
i mean i'd like to find a way to make a real nice 3D model for some propeler but not certain where to get the right info
and get a real conform 3D model ?

RickyBlender
04-Oct-11, 14:23
if you need to get the latest version go here

http://www.graphicall.org/569
click on the right on the icon for your system
and then select the latest version with add on contrib if you want to get latest scripts

i just got 40-789 for vista

have fun

Witold Jaworski
04-Oct-11, 15:15
...
is there some web page where you can get the blade shape in 3D to be done in blender
i mean i'd like to find a way to make a real nice 3D model for some propeler but not certain where to get the right info
and get a real conform 3D model ?


In general, the propeller blade and the wind turbine blade have similar geometry. They are like an airplane wing, but twisted around their span, to keep a constant angle of attack (just a few degrees) to the airflow along whole blade. (The airflow is a vector sum of two velocities: the wind and the rotation of the turbine. This second component is growing in a linear fashion along the propeller radius). Maybe you would look at the pages 100 - 108 of this free e-book (http://airplanes3d.net/wm-000_e.xml). I have shaped there a little bit simplified propeller blade. Well, the text is in Polish, but there is a picture for every step, and the Blender commands are in English... Maybe it will give you an idea about the geometry.

RickyBlender
04-Oct-11, 15:28
which one should i get

is it the first one

http://airplanes3d.net/downloads/wm/wm.pdf

then go page 108 to get how to shape it

i hope you can translate it in English seems to be a very interesting tutorial

would make it easier for peoples here on forum to read and learn from it!


but i was also interested in the standard plane properler
ok this may not have anything to do with windmill blades

but still interesting how to shape a nice prop with right twisting which is not that simple!

thanks for feedback

santasemilla
04-Oct-11, 17:51
which one should i get

is it the first one

http://airplanes3d.net/downloads/wm/wm.pdf

then go page 108 to get how to shape it

i hope you can translate it in English seems to be a very interesting tutorial

would make it easier for peoples here on forum to read and learn from it!


but i was also interested in the standard plane properler
ok this may not have anything to do with windmill blades

but still interesting how to shape a nice prop with right twisting which is not that simple!

thanks for feedback

Hi again!

Do you know X-Plane? It is an excellent flight simulator and it has a very big community of developers. Airplanes aerodynamic forces are computed in real-time using Blade Element Theory (http://s6.aeromech.usyd.edu.au/aero/propeller/blade_element.pdf). The thing is that people model propellers and blades on a quite realistic way. Have a look at the community forum. You will find a lot of information, examples and guys doing the same things you want to do ;)

Have fun!

santasemilla
04-Oct-11, 17:51
Couldn't post multi-links in one post. The X-Plane community forum you are looking for is here (http://forums.x-plane.org/index.php?showforum=30)! ;)

santasemilla
04-Oct-11, 17:53
....and the Blade Element booklet was taken from here (http://sites.google.com/site/aerodynamics4students/), just for you to know.

RickyBlender
04-Oct-11, 18:38
what is the site for this group of people for the propelers ?

this booklet seems very intersting

it would also be interesting to see a solution for this in python
may be can find this on this group site

have you prepared your little intro for you project ?

so we can try to help you

santasemilla
04-Oct-11, 20:57
Ok, as I previously posted, I’ll try to make a summary of what I’m doing for my research.
The study of wind turbine blades is crucial as the size of commercial turbines tend to grow exponentially. The blade of a wind turbine could be seen in a simplistic way as a propeller blade. Let’ s make the first big difference here. On a propeller, a torque is given by the engine and the propeller produces thrust force interacting with the air. On a wind turbine, the blade captures the energy from the wind, the aerodynamic forces produce a torque and finally that torque is driven by the shaft to a generator to produce energy. Thus, the design is similar, but the functions are not. Ok, a blade could be simply modeled as a cantilever beam. If we imagine this, it is not too difficult to see that the structural efforts will be concentrated at the root of the blade. Here comes a second big difference with propellers. Propellers are normally short blades made from a single airfoil section, a small change in the airfoil chord along the blade, and a specific twist according to it’s design. (mmmm… I’m assuming here that you understand what an airfoil chord and twist is!). Now if you see a wind turbine blade (mostly for big wind turbines) you will see that from the root to the ~25% of the span (blade lenght) the airfoil sections tend to be thicker than usual. Why is that? Because of the structural forces that the blade needs to deal with in that zone! As you go upper in the span, to the “aerodynamically active” part of it, the airfoils tend to be more like the ones used for helicopters (NACA64 series) or thinner airfoils families like the Delf series DU300 – 250 – 180.

Ok, why all this intro? Just to say yes, while they operate, wind turbine blades deform and they can deform A LOT. The ultimate deformation (and the one that everybody wants to avoid) is when they bend so much that they hit the tower and… end of the story. Moreover, the blades should be as light as possible, you don’t want to waist energy moving it, you want all that energy to go to the generator so, you want a light blade! …but wait, if it’s light it will deform even more! Yup, that’ s why is so important to get a clear idea of how much and in WHICH WAY it will deform.

Today’s physical testing on the blades could be like in this picture, where you bend it and measure the deformations. That is call static testing. You could have a very good idea of how the blade is going to behave as the design condition is also a “pseudo-stationary” condition. You suppose a “constant” wind, design your turbine to operate with that wind and get the best of it… and so you could expect blade deformations in the order of the ones you got while testing. Again, very important is PSEUDO-stationary, as the machine is turning, wind is never constant, you have the electrical grid commanding the decisions over the turbine controls, etc, etc, etc.

156779 156781156780


When you do blade testing with computers, you have many options. The most expensive one (computational resources and time) but the best would be to do a full 3D analysis of the blade. You have composite materials, funny shapes, changes in thickness and distribution of internal structures along the blade so…. Imagine my Blender friends how dense should be the mesh to do a good analysis of what’s going on there! Wait, don’t get me wrong! You CAN do this, and there is always a compromise with the mesh and the level of description you want to achieve to make things feasible! But a good analysis could take a huge amount of time even in today’s super computers. Also, forget about this under dynamic simulations.

Another approach, the one I’m using, is to divide the 3D problem into a 2D problem at the corss-sections of the blade + a 1D problem modeling the blade as a 1D cantilever (and rotating) beam. The 2D problem is very complex to explain in simple words, but you can find a brief introduction in the PDF I’ m attaching as well as in the inside references. The idea is to obtain a full stiffness and inertia matrices for the cross-section (and repeat this process in as many places along the blade as you want/can) This matrices will provide information for the flexural modes, torsional modes, combinations and interrelation of this modes. This is something extremely useful and rather new technique. It could only be solved by finite elements methods (I mean, there are not analytical solutions) and the method is called Variational Asymptotic Beam Sectional technique (VABS) based on a Generalized Timoshenko Beam Model (GTBM).

The 1D model consist now in a dimensional reduction, where the properties of the cross-sections computed before are now assigned to a node in a 1D mesh (imagine a long rope with knots along it ;) ) . Now solving time-dependant problems or stationary problems on a 1D mesh is orders of magnitude cheaper than solving a full 3D problem. The advantage here is that the information at every node of the 1D mesh corresponds to the 2D cross-section and is very reach. This dimensional reduction technique is also complicated mathematically and you can find a small introduction as well as references in the PDF.

Ok, I haven’t talked about the aerodynamic model but this post will be kilometric and will go far off-topic. The description of it, at the time of my proposal defense, changed quite a bit. Nevertheless, the basis of it still the same.

All right, now you may understand (or maybe now you are totally loss) why I’m trying to deal with Blender. The idea, as stated at the first posts, is to post-process the data coming from all the above model. Among the data I can output, I obtain displacements and rotations at the nodes of this 1D mesh (which I called my “Blade’s reference line“ ) and those displacements and rotations correspond to the cross-section on the blade at that location. Solving a dynamic problem I get a set of data for every time-step of my simulation. That’ s why I also said that I have defined a time frame with all the steps. My animation could be think as animating a collar, but instead of little balls, you have airfoil sections (yeah yeah, interconnected and looking as a single solid body, not like an accordion).

Ufff! That was long. I hope you could get now a better idea of the general picture.

I think this forum and this post won’t be a good place to start discussing the theories mentioned in the PDF or in the above introduction. The intention of all this is to apply Blender (and python scripting) to a project. Take it just as that and let’s leave this anecdotic long post as the catharsis (uops! …general description? ;) ) of a specific application.

Thanks for the interest again to all of you reading this!
Lucas

PS: I couldn't attached the PDF here due to limitations with the file size in the forum. I put it here (http://www.megaupload.com/?d=PMZX)
(http://www.megaupload.com/?d=PMKZX1UU)

santasemilla
04-Oct-11, 23:18
mmm... I did a big post a couple of hours ago with a long description, but it seems it was not published. Maybe it is under revision 'cause it is too long? Anyway, I have a copy so if tomorrow I don't see it posted, I'll re post it in 2 or 3 parts.

Witold Jaworski
05-Oct-11, 02:54
Thank you, I think I have understood the "beam" approach to this blade (it is similar to the 1D "beam" simplification, used sometimes to model the wings of small aircraft).

So there will be two sets of input data (ASCII text files):

1. the "non-deformed" geometry of the blade (all sections, as the airfoil data, are described by the same number of vertices, aren't they? I think I would be very simple to generate the mesh model from this data, you do not need to make any specific "skinning"): section number, height (on the blade), x, y-upper, y-lower (let's assume that the point of the Blade reference line - the origin of the section - is at x=0, y=0. This assmumption would be wrong, if the non-deformed blade reference line is not a straight line. In this case we need to specify its x, y per each section). This is very similar to the format, you have proposed on the previous page, in the post #5. Just the "header" of each section:


Blade NREL5MW intermediate airfoil # 0026 @ 0.7717

has to have at the begining a keyword (it can be "Blade" - but it has to be a fixed text) which would allow the program to immediate recognize it as the begining of a new section. This line would contain the section id (#0026?), the height (@ 0.7717), and the eventual information about its x, y origin, if the blade reference line is not a straight vertical line...



2. the airfoils deformations: section number, translation (x,y,z), rotation (Euler angles? Quaternions? I think that quaternions are better): one file per each frame of animation? We can also to interpolate the deformations "between", linear or by the Bezier curves, but for the larger differences of interpolated rotations it may give some strange results.

Using these data, the Python script has to create in a Blender file the mesh model of the blade, and set up the animation sequence. It would be ready to play...
The "static" content of the Blender file would contain the lights, background, and all the other "artistic" stuff needed to create a properly looking renders of this animation.

At this moment it seems quite simple.

Let's begin with the geometry (point 1). Is the proposed format OK? If it suits you, could you give us a real sample, to test the script that would generate the mesh? The key point is the easiest way to apply to this mesh the deformations from point 2, but I will try to propose something...

RickyBlender
05-Oct-11, 09:37
very interesting subject

this will lead to the desing of what windmill size in terms blade size and of Megawatts ?


also you seems to say that all these algos cannot be resolved on PC it has to be done on a Super computer


on ly general note i did not see is the effect of bumps on the blade surface which could increase the Efficiency of energy transfert
Some research where done on this subject at CNRC a few years back studying whale's fins
i mean nature has a way to solve problems which is amazing and usually simple!

can you give us the first part and what the data is and what to do with it !

here i'm assuming your running blender on a simple PC and not on a supercomputer

don't know if it will be able to handle all data's in a realistic time may be you could use a PC farme to do the rendering !

daren
05-Oct-11, 09:55
Does ProE do a lot of stress analysis and flow dynamics already? Are you looking into writing your own algorithms?

RickyBlender
05-Oct-11, 10:12
by the way i wish gyou ood luck with your project

if you can find a way to use PC to simulate this engineering (Mech/structure problems with finite elements)
instead of using Supercomputer i guess it would be a step foward in terms of simulation/modelisation
and would help make the design of windmill blades or other propeler types faster and easier by using PC

I'm stil trying to find if there are any simple Python scripts to do simple Finite elements modelisation for simple beam!

mind you i'm not into mech/structural design
but still an interesting in this subject
and even more if it can be use in blender

so bring us your first step which i guess is the blade model in blender may be
or give us what has to be done as a first step

Witold Jaworski
05-Oct-11, 11:11
I have quickly checked the possibilities for applying mesh deformation, and finally come to the conclusion, that an armature is the best solution. It will contain disconnected bones, one bone per each section, and each section will be defined as a mesh group. It seems that it will be relatively easy to generate such an armature programatically.

RickyBlender, we have to process the results, not to make the main computation.
(BTW:
- the beam model is an simplified one, that's why it does not require a "supercomputer". You underestimate the power of your PC :).
- the skin of the whales actively controls the boundary layer, which is still not possible for human technology, at least in the practical applications).

santasemilla
05-Oct-11, 12:00
Hey!

Nice to hear from all of you. First of all, commercial codes now a days doesn't allow the type of analysis I need to do. As I said, yes, you could do a full steady state 3D case , but it is not what I'm looking for. Also, great thing there are no commercial codes doing this! Otherwise my thesis proposal would never have been approved as something innovative! :) About the super computers and standard PCs, yes you can do this on standard PCs too! It will take longer, but you can still do it of course.

Ok, going to business!

Witold, All your assumptions are right, but I can tell you that it could be even simpler! I'll tell you why:

1) The data I posted contains only XY data, but you are totally right! The blade axis could be a non straight line!!!! This is SUPER important as blades can be pre-bended, contain a swap back, etc. What I can do is to process the coordinates of the airfoils multiplying them by the corresponding rotation matrix which will output the coordinates in their real final position. I mean, only by loading airfoil after airfoil, you could have it positioned along the blade axis and with the corresponding twist. I think that would help a lot. What you think?

1b) The 1D mesh (blade axis) could be imported and positioned exactly in the same way as the airfoils, instead they will be just a collection of XYZ coordinates in a form of a line. It is important to note here that I could have, for example, 20 blade sections, but 150 points on my 1D mesh. Why?! Before the solution of the 1D problem, the calculated property matrices for the 20 airfoil "stations" are interpolated for the 150 nodes of the 1D mesh. Again, details of this process will be totally off-topic if discussed here, but it is important to note that my blade "model" could have 20 airfoils and the 1D mesh (where displacements and rotations are computed) could be for 150 points. This also simplifies what you said about interpolating later displacements and rotations!

2) You don't have to worry about the "deformed" coordinates of the airfoils! ;) Great second news! Why? Deformations and warping are recovered after the solution of the 1D problem, for every section. For This blender project, let's say that my intention is to animate the 1D mesh surrounded by the external real blade "skin". It would be like animating a whole snake just by doing it by it's skeleton. That's why I thought at the beginning "bone animation". The "deformation" of the blade should follow the rotations and displacements of the blade axis. This is not totally and perfectly accurate, but for the sake of showing what's going on a dynamic study, with 3 displacements and 3 rotations at, let's say 150 points along the axis, is more than enough. To compute stresses, real deformations at every section, etc. I wouldn't use Blender by now.

OK, once again I'm super happy to find people like you guys wanting to help this Blender noob here! Thanks! I will try to post a complete package with the ASCII files for the airfoils and for the blade axis as soon as I can.

See you around!

RickyBlender
05-Oct-11, 12:28
1- Whale's fin
this has already been done at the CNRC and verified on a practical point of view!
and it works but very modern only 1 year old

2- I'v seen a script for 2.5 something to make the shape of wings !
don't know may be it can be use !
i'll check out this script but it does not have animation

3- data
can you upload some sample files of data for the different parts so we can begin to look at it

like one file for the chord or center line i guess something like 150 points that should be easy to do
The 1D mesh (blade axis)

then may be the first cross section which i assume would be the first frame for the simulation
or the first frame has all 20 sections may be with a certain shape like twisting and bend!

not certain how you want to proceed here

4 - do you want this as an addon with a small panel in tool pro section may be?

i can begin a small script like that easy to do !

RickyBlender
05-Oct-11, 13:44
ok here is the script i think was done for wing

http://blenderartists.org/forum/showthread.php?231820-NACA-Airfoil-Generator

let me know what you think

i think there is also another one using data from a file
but cannot remember whre it is
i'll ask question in python forum

Witold Jaworski
05-Oct-11, 15:10
I am just curious, how this blade will be deformed under load (maybe because I have studied on a faulty of similar profile :yes:).
Ricky, the add-on you have pointed generates airfoils from the so-called NACA family. They were widely used in the middle of previous century - really a great, good family. This case is different: the airfoil will be our input data of point 1. We have just to generate a mesh from it.

santasemilla: I have exactly the "snake" idea of the blade reference line in my mind, writing this proposal, as you have dscribed. So single line of the data file from the point 2 should contain:
#ordinal number of the reference line point,
its current location (x, y, z)
its current rotation (a quaternion)

the frame will be identifed by the file name?

We will need also a "zero frame" file with the geometry of blade reference line for the undeformed blade (could we assume, that the points on the undeformed blade line have no rotation?)
I think, that the simplest way to couple it with the "skin" will be to interpolate the additional sections between the given airfoils, to obtain a 1:1 relation between the reference line and the airfoils of the mesh. (The script has to do it, adding to the mesh additional cross-sections on the level of each reference line points) Otherwise we can have troubles with realistic deformation of the final object.

RickyBlender
05-Oct-11, 15:14
well if you do it with bones and let say you have one frame with 20 sections

you can assign verts group for each section and have an armature with 20 bones then apply a rotation localy and may be a translation
for each bone
then the weigth factor will adjust automatically the deformation for each section and should be smooth

for the next frame you can readjust the verts location then change the bones rotation and it will self adjust for these new verts locations!


if that's the idea here!

Witold Jaworski
05-Oct-11, 15:27
Ricky, you are right. I have proposed to generate a section per each blade reference point, because it seems to me simpler and I think it can give better results, than to play with the weights, having, let's say, 3 bones per each original section. I have just checked, that you can freely control rotation and location of each disconnected bone. Here is my test file: 156845 (just three sections and three bones, just to check if it works)

RickyBlender
05-Oct-11, 15:38
ok but he armature 's bone line have to follow the center line of the prop



i think you still need to define vert group here!
or if you don't use vert group how do you change the location/ rotation of the sections?


so we need this line from our friend here!

santasemilla (http://blenderartists.org/forum/member.php?105943-santasemilla)

please load up some data file here for the center line and may be one or 2 frame of data 20 sections per frame or less
to start with to begin testing

but how do we get the continous shape of the whole prop here
we have to do it manually from each section to next section?


by the way is there a way to copy the name at the top of a post without the color problem?

Witold Jaworski
06-Oct-11, 04:28
ok but he armature 's bone line have to follow the center line of the prop

in fact, the bone line of the armature will be the center line of the balde - because the propeller sections will have not any specified origin point.



i think you still need to define vert group here!
or if you don't use vert group how do you change the location/ rotation of the sections?

Examine the mesh and the armature in the blender file I have enclosed in the post #36. You will notice, that there is a vertex group per each bone.



but how do we get the continous shape of the whole prop here
we have to do it manually from each section to next section?

Yes, I think that the Python script has to create the mesh - it is not so complicated :).
In each point of the center line (let's say 150) we will have to place a bone.
The additional operation will be to calculate coordinates of the the arifoil section of the blade, that matches (1:1) the position of the bone. It could be calculated as an linear interpolation of two neighbour sections, got from the geometry file (Let's say that we have a section at Z0, another at Z1, and the bone is located at z, which is Z0<= z <= Z1. The coordinates of the section that corresponds to bone at z can be calculated as v = V0*t + V1*(1-t), where t = (z-Z0)/(Z1-Z0)). From these vertices we would build the mesh, naming each section as a vertex group having the same name as the corresponding bone. So per each reference line point the script would have to perform following operations:
- create (by duplication) a new bone and assign it an ordinal name (like "026")
- identify in the input geometry the "neighbour" sections
- calculate the points of the new section, which corresponds to this bone, from the identfied input geometry
- use these calculated points to add another "collar" of faces to the mesh of the blade
- make from these new vertex loop another vertex group and give it the same name, as the bone (like "026").

The input geometry data could be kept in a dictionary, where the Z position of the section would be the dictionary key: {Z0:[V0], Z1:[V1],Z2:[V2], ...} because it would make easier the lookups


Then the input data from point 2 would allow to set the key position and roatation per each animation frame.

RickyBlender
06-Oct-11, 08:48
i did look for the V group but did not see these in file

i'll check again!


but don't think you need more then 20 bones one per section in any case he does not have other loc/Rot values so not very usefull to have more then that !

one idea here why not add some V color function of the rotation so you can see a better representation of the rotation in viewport on function of the translation may be!

not certain with dic never really use it a lot before but might help!

another thing here is that this could be made with Nurbs circle extruded or Bezier extrude may Be
at least no problem to make faces!

then transform into a mesh and cap it may Be

then play only with bone weight and Rot/Transl

ounce the basic model is made for the prop only ting left is to re adjust the Rot /Loc for each section!


if you have an idea start it for the basic shape for the whole prop which can always be change afterward and add all the bones from B1 to B20 with V vgoup and Vert color may be

that part should be easy and only done ounce i think for a prop model


after only thing left is the Rot/Loc for each section per frame

i'll try to come up with a little script for tool pro with an operator to read file and do it

salutations

RickyBlender
06-Oct-11, 09:18
got this model i did here with 20 sections

let me know what you think

ok did not do armature and V group but it's basic shape unless he can provide us with a given shape

156912


156914

RickyBlender
06-Oct-11, 09:57
ok got a tool pro panel script with a simple menu for different actions

got to add the file read operation in this later waiting to get more data so we know what to do with it


156921

made it with CC licence
added your names guys

you can add more doc if you want in it

try to change the version at end of file name and script name if you make a new version

have fun

santasemilla
06-Oct-11, 11:09
Woow wow! ...this is going too fast, I cannot keep the pace! I'm very busy right now with many other things. I'll do my best to post the real blade sections as soon as I can. But reading the previous posts, yes, that's exactly the idea!!

Thanks again and I'll be back as soon as possible.

Witold Jaworski
06-Oct-11, 11:21
All right, we are waiting for the data.
Ricky, I think that I see what you mean: to build just the mesh and connect it to the armature BEFORE, and then just update its vertices according the input data? Well, yes, it is simpler than my proposal, but also fixed to predefined number of input sections and bones. I have just proposed a more general solution, which would work for any number of sections and blade reference line nodes... Anyway, which is better depends on the santasemilla's data. We will see. About your UI - do not hurry, i think that that the [Run Script] button will be enough at the beginning :).

RickyBlender
06-Oct-11, 12:42
script is only general for now need more info for the data and options if needed

but we have to wait and see how the data comes with what format ect..

then might be able to get some real things here

but should be interesting

but no harm done if we get it running with the bones Vgroup already done and may be some V col too

hope he can be back with a more specific shape and some data for the center line and some cross setions
to see how to deal with it

ounce it works with 20 sections it will probably be easy to add more sections!

i'm more concern with time to compute prepare the V group and render all the frames here


santasemilla

can you tell us how many frames your planning to do here or how much time you think you gone need for simulation?

if there is one file per frame (for 20 sections ) for the data we need a way to name these files may be with a sequential number in same folder then easy to read the different file/data then process it


also why is there 150 points for the center line
does it means that the center line is not a straight line like the foil is bend may be at the beginning of simulation meaning there is already a speed on the prop which tends to bend it or because of outside perturbations the prop is bend like the wind changing the shape may be?

and how do we relate this 150 points to the sections
i mean is it linearly subdivibed like 150 /20 ?

for the sections you get some data but it is for the center of the sections i assume and not
the beginning or the end of the section!

RickyBlender
07-Oct-11, 15:32
Witold-Jaworski (http://blenderartists.org/forum/member.php?31311-Witold-Jaworski)


ok did some experimentation and can get all the bones to be automatically generated

but do you think if we use auto bone assigment it will do a good job or if we gone have to do it manually somehow?

in we use a predefined propeler shape for instance then simply locate the bones where the different sections are located or linearly along the chord /20 !



like using

mod.use_bone_envelopes = True


thanks

Witold Jaworski
07-Oct-11, 15:45
but do you think if we use auto bone assigment it will do a good job or if we gone have to do it manually somehow?



I have always used them this way - Blender automatically assigns vertex group that have the same name as a bone, to this bone.
No additional action is needed!

RickyBlender
07-Oct-11, 15:56
I have always used them this way - Blender automatically assigns vertex group that have the same name as a bone, to this bone.
No additional action is needed!

sorry i met defining the vert group automatically not the assignment Vgr to bones!

Witold Jaworski
08-Oct-11, 03:42
To learn , how to define a vertex group using Python API, do it first manually, examining the content of the Info window.
You will learn the operators, used in this process, this way.
Then try to build a script, which does the same.
(I have described it in the Programming Add-Ons (http://airplanes3d.net/downloads/pydev/pydev-blender-en.pdf), section 3.5. This is a general method for learnining "how to do XXX in a script").

RickyBlender
08-Oct-11, 08:51
got some good example from Thomas code snipept too

but still wondering about the automatic assigment
it can do a good job in most cases but not always

anyway we can try and test it when we have the real shape

hope he an come back with proper shape and some example of data so we an look at it and see what to do!


salutations

RickyBlender
20-Oct-11, 17:50
i tried the soft for prop and got this pic with some cross sections i think for the blade

is there any data for this cross section or only the pic

and why is the cross section not the same height then the blade itself?

see pic
158152

and is it possible to draw in 3D the blade's shape from these datas?

thanks

santasemilla
21-Oct-11, 00:34
i tried the soft for prop and got this pic with some cross sections i think for the blade

is there any data for this cross section or only the pic

and why is the cross section not the same height then the blade itself?

see pic
158152

and is it possible to draw in 3D the blade's shape from these datas?

thanks

Hi RickyBlender, (http://blenderartists.org/forum/member.php?33535-RickyBlender)

I really don't know what that software is. If you know the airfoil denomination you could find information online about it, but just from see it in the picture I cannot tell which one it is. Also, what the picture shows you there is the Blade Twist distribution, and he is plotting the airfoil profiles with the corresponding twist along the blade. As it's a 2D representation, you can't easily see the "helical shape" and, again, it is just as a technical reference.

For your last question... yes, you can. You need to know the airfoil shapes, position along the axis, and individual twists.

Want to have fun with airfoils? Here you have kind of a "bible" (Not only for Wind energy, regardless of the top picture) ;)

http://www.ae.illinois.edu/m-selig/ads/coord_database.html

Have fun!

santasemilla
21-Oct-11, 00:39
Well,


After many many days of my last post, I'm here to add part of what I promised. I've been very busy with other things and my plans to submerge my head into Blender had to be postponed... and will be a bit more unfortunately. Nevertheless I keep preparing the things for that time and work on the Matlab side of the project with the things that I will need to pass to Blender.


Ok, here we go! In the zip file you will find basically the skeleton of a test blade. This test blade is made of 23 airfoil sections, every file contains the structure mentioned way ago on the sample data:


-First archive line: A description. Let's just don't pay attention now to this, let's say that in the future we can put some information here as “section # out of xx” etc.


-Second to last line: This are the X Y Z coordinates that define the airfoil in the exact position on the blade. With this, after loading all the files the blade will be defined, including twist and, if corresponds, the initial design deformations (in this case the blade axis is straight, so don't worry.)


In the same way we have the axis coordinates. As I just said, the axis is a straight line so for this case only the Z coordinate is nonzero. Here, instead of 23, the points are 93. In the figure I'm attaching, every node of the blade axis is marked with an “ * ”. These nodes are the ones that later will be animated! So yes, you guessed it, the “vertebral column” that we talked about before is this axis. Bones for the animation should be defined by the segments from the coordinates.


The last file in the package contains the coordinates for the blade tip. What is this?! As the blade is a solid that is going to be “extruded” along it axis, there should be a way to define how it ends! If you see the example of the boat I used to describe the idea in the OP, the last cross-section, the after-peak, is inclined to define the way the boat ends. Here the case is a bit different, I know. The boat is an open solid (mesh), here the blade is closed. Here the blade tip is perpendicular to the cross-sections and “extruding” of the blade should have this exact shape at the end. ...How I do that in Blender?? I have NO idea. Couple of thoughts:




Easiest: If it's there a command or function under modeling and the problem is easily solved but I just ignore it from my lack of Blender knowledge... just forget about this discussion. ;)
Maybe the blade tip could be part of a second “auxiliary” solid to then subtract to the main blade and get the final shape. Autocad/SolidWorks ideas coming back to my mind after long long time. (mmmm.. am I clear here?)
I can re-define the airfoil coordinates so I can load them in two halves. Let's say a bottom and a top one, as if the final blade were made out of two molds (...hehe that's how they make it in reality!). In this way, the blade would be exactly the same as the boat example, but with a bottom and a top “hull” hehe.



Anyway, by now, I'm just uploading the data, otherwise I'm delaying too much the progress here.


If all is loaded into Blender, you should end up with something like this:


158167
(sorry for the awful perspective! ...Matlab's fault! Hehe)

Well, here the zip file: 158168

Note: I almost forgot it. You will see that some airfoils are not closed at the trailing edge (the tail). This is not an error. Thick airfoils could have a blunt tail so don't be surprised if you see this. ...mmm yes, again, I don't know if this could complicate the extruding, hope not. If it does and we need to close it, just let me know.

Note2: All units are in meters.


I have to thank again all the help and interest you are providing to this project people! I really appreciate it.


See you around!
Santasemilla

santasemilla
21-Oct-11, 01:31
I was re-reading all the previous posts and thought that maybe my 23 airfoils + 93 axis-nodes could complicate the armature concept. If you guys think that it would be better to define an airfoil section for every axis' node, I can do that! Just let me know what could be best. Moreover, if I define more sections, maybe the blade-tip curve won't be necessary (just a thought).

Take care.

Witold Jaworski
21-Oct-11, 03:22
If you guys think that it would be better to define an airfoil section for every axis' node, I can do that! Just let me know what could be best. Moreover, if I define more sections, maybe the blade-tip curve won't be necessary (just a thought).

Take care.



Yes, it would be much more easier to have in the input data the 1:1 correspondence of airfoils and axis nodes. Anyway, because programming is the art of proper assumptions, can we assume that:
there will always be an element named "Blade tip". (In spacial cases it can "degenrate" to the last airfoil);
all airfoil sections and the tip are described by the same number of points (it is allowed that two different points have identical coordinates, when needed), and the mesh should be created by connecting the points of the same ordinal number (first with first, second with second, etc);
points of every airfoil and the tip descibe a single closed loop. The last point should be always topologically connected to the first;
there is always element "Axis Coordinates"
number of the points of the "Axis coordinates" is equal to the number of airfoil sections
the "Blade tip" is fixed to the last airfoil section (they share the same bone)
input file format: see below
Browsing these data, I would propose just to "glue" all the geometric data into a single file. The first line, you have placed at the begininig of each section, will be used as the delimiter, in this case. So the file will begin with line like this:



Blade NREL5MW_s46v23N51 intermediate airfoil # 0001


Can we assume that the format of this delimiter line can be interpreted as:


Blade<space>{Blade name without spaces}<space>{element description}

where:
{Blade name withouth spaces} will be used as the Blender file name;
{element description} may contain following texts:

"intermediate airfoil <ordinal number>", for example "intermediate airfoil # 0001"
"Blade tip"
"Axis Coordinates"

The order of these elements in the file is not important, but file which would miss any of these elements will be treated as incomplete.

Using the data from the file you have delivered in the previous post, I will prepare a first version of the script that generates the mesh of the blade. For this first test I will skip the bone creation (because the "Axis Coordinates" are required for this). Then, when you will deliver the updated version of the input data, with 1:1 correspondence of the nodes and the airfoils, I will update it to obtain the final setup. Of course, every version of this code will be published here, in a zip file. This way you will be able to examine and modify it.

RickyBlender
21-Oct-11, 09:38
first requirements to help us work with these files!

is it possible instead of naming the file .dat to name these .txt or as ,py
which is probably even better i can see all the text as normal lines

then we can open directly with txt editor!


wll look at datas today



first problem

i cannot open file 002 and 004 i see chines txt so cannot read data here!

001 and 003 is ok i can open by changing name to txt or py and can read it !

files seems to be corrupted here ?


ok so here we also assume that your blade is vertical like in pic shown
so only Z will change for the height of the section



thanks

Witold Jaworski
21-Oct-11, 10:05
Ricky, in these files single CR character is used as the line delimiter (it is a Unix/Linux convenction), instead of CRLF (Windows convention). Use, for example, Notepad++ to scroll their content. If you want to do open them in "one click" way - assign in your Windows the *.dat extension with Notepad++. They are still properly read by Python functions - as the text files.

RickyBlender
21-Oct-11, 10:11
ok i see i'm on vista hope it does not create any problem

are you on vista and our friend is on vista too or not ?

that could create some problem for the file reading !



just tried to read the first file 001 and get an error on line 28
but cannot see anything wrong in txt file

see error here

airfoil1.py", line 28
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in positio
n 2-4: truncated \UXXXXXXXX escape

not certain what this error is

if you need new little script to read data let me know i'll upload it
but basically same as i use before

santasemilla
21-Oct-11, 10:17
first requirements to help us work with these files!

is it possible instead of naming the file .dat to name these .txt or as ,py
which is probably even better i can see all the text as normal lines

then we can open directly with txt editor!


wll look at datas today



first problem

i cannot open file 002 and 004 i see chines txt so cannot read data here!

001 and 003 is ok i can open by changing name to txt or py and can read it !

files seems to be corrupted here ?


ok so here we also assume that your blade is vertical like in pic shown
so only Z will change for the height of the section



thanks

Hi there,

I can rename them to .txt if that's what you want, no problem with that. Regarding files 002 and 004, I don't know what to say. I just downloaded the posted zip file just in case and I can see the data perfectly well. Tried it under Linux and Windows machine... don't know why you are seeing "chinese" text (I want to believe that means corrupted data). I'm working in the new set of so don't worry, I'll re-upload a zip soon.

Your last assumption is right for this case. I say for this case because the axis line could be non straight as previously discussed, but yes, for this case the axis changes only with Z. Once we have the 3D model, we can triplicate it rotate to other positions, combine with other elements, etc. ...but that's for the future.

Thanks!

santasemilla
21-Oct-11, 10:20
Ricky, in these files single CR character is used as the line delimiter (it is a Unix/Linux convenction), instead of CRLF (Windows convention). Use, for example, Notepad++ to scroll their content. If you want to do open them in "one click" way - assign in your Windows the *.dat extension with Notepad++. They are still properly read by Python functions - as the text files.

Ok,
Ricky, Witold, let me know if I should change the extension from .DAT to .TXT.

Witold, I'm answering your post in a minute ;)

RickyBlender
21-Oct-11, 10:40
ok let me do some read text some more

i think the unicode error hasnothing to do withnthe data more with the new path filename i added in the script

i'll check some more

be back soon

thanks

RickyBlender
21-Oct-11, 10:59
ok i corrected the little script and now i can read the datas

even file 2 and 4 which i cannot open with txt editor !

now have to check for qty of data not certain why i get 500 instead of 501 data !

let me work on that problem

santasemilla
21-Oct-11, 11:09
Yes, it would be much more easier to have in the input data the 1:1 correspondence of airfoils and axis nodes. Anyway, because programming is the art of proper assumptions, can we assume that:

there will always be an element named "Blade tip". (In spacial cases it can "degenrate" to the last airfoil);
all airfoil sections and the tip are described by the same number of points (it is allowed that two different points have identical coordinates, when needed), and the mesh should be created by connecting the points of the same ordinal number (first with first, second with second, etc);
points of every airfoil and the tip descibe a single closed loop. The last point should be always topologically connected to the first;
there is always element "Axis Coordinates"
number of the points of the "Axis coordinates" is equal to the number of airfoil sections
the "Blade tip" is fixed to the last airfoil section (they share the same bone)
input file format: see below

Browsing these data, I would propose just to "glue" all the geometric data into a single file. The first line, you have placed at the begininig of each section, will be used as the delimiter, in this case. So the file will begin with line like this:



Can we assume that the format of this delimiter line can be interpreted as:



where:
{Blade name withouth spaces} will be used as the Blender file name;
{element description} may contain following texts:

"intermediate airfoil <ordinal number>", for example "intermediate airfoil # 0001"
"Blade tip"
"Axis Coordinates"

The order of these elements in the file is not important, but file which would miss any of these elements will be treated as incomplete.

Using the data from the file you have delivered in the previous post, I will prepare a first version of the script that generates the mesh of the blade. For this first test I will skip the bone creation (because the "Axis Coordinates" are required for this). Then, when you will deliver the updated version of the input data, with 1:1 correspondence of the nodes and the airfoils, I will update it to obtain the final setup. Of course, every version of this code will be published here, in a zip file. This way you will be able to examine and modify it.

Hi Witold,


Sure, I understand perfectly. Correspondence will be 1:1 then. Let's go check the assumptions:




Yes, we can do that if you want... but if I assign an airfoil to every node, I'll end up having a cross-section at the 99.14% of the span so I don't see it practical to have a tip defined between the 99.14 and 100%. What do you think? I'll include it on the next package, but if it does not make a difference, we can ignore it.
Yes, this is correct. I was wondering if the blade-tip should had half the points of the airfoils as you were going to connect two nodes from the last airfoil to the it. (I mean one node from the upper surface and other from the lower one) But if you think as it is is good, let's leave it this way.
Yes for the airfoils and.... if you want to think the blade-tip as something ”glued” at the end... then yes.
Yup, that's right.
Yup, always.
Right.
Your interpretation of the first line is right, and I can stick to this naming. What I don't seem to understand here is what do you want to “glue”
I would propose just to "glue" all the geometric data into a single file. Do you want me to keep this description you mean? If this is the case, sure, no problem. If not, sorry, I didn't understand.

Thanks a lot Witold!

Witold Jaworski
21-Oct-11, 11:26
By "gluing" the files I mean to write all these data (the content without changes) into a single file.
For the testing purpose I have already done it.

Here is the first zip file: 158209

It contains the test file I have used as the input (this file has been created by joining all the files of your data), and the first version of the script blade.py.
At this moment just the first step is implemented: loading the data from the files into a data structure.

I have just written the main details of the code that will create the geometry from this data, so I will check and publish them within a few days. At this moment they are just on two pages of the paper. (I am an "old school" - any non-trivial code I write with the pencil and the paper, first. Then, when it looks good, I type it into the computer :eyebrowlift:).

RickyBlender
21-Oct-11, 11:30
data read ok for all 501 data's in file

now i can change the file extension to what i want no problem
it's all txt data anyway to be converted to numbers

and working ok now !

now these 501 data represent the shape of each cross section ?

that's a lot of data i think we don't need that many for the shape could be defined with less then 32 verts?

animation and render would be a lot faster !

what do you think here ?

be back in about 1 to 2 hours !

santasemilla
21-Oct-11, 12:51
All right,

Right out of the oven, fresh data. I've made a new set with 92 airfoils + Blade-tip for the 93 nodes in the Blade-axis. Now all the shapes are defined with 65 points instead of 501. Yup, that could be a lot of points, let's try with 65 if they are still too much, we can lower it later.

A new file "NREL5MW_s46v23N51_Datapack.dat" is included. This file contains the "glued" information lines from all the rest. Single files still contain the description in the first line.

Hope it helps! Let me know and thanks, as always!

158213

Witold Jaworski
21-Oct-11, 13:13
Well, could you prepare exactly 1:1, that is 93 airfoils and 93 nodes? As I have written, the Blade tip is an extra "shape refinement" and will be fixed permanently to the last airfoil section (in this case - # 0093)...
There is another issue: look carefully at the input data from the post #63. It contains all the data you have originally placed in the separate files (not only the first lines, but also the coordinates). Could you prepare something like this?
Actual *Datapack* file from the post #65 is unusable for the script I have prepared...
I would propose to produce just a single data file for all sections, like in my example, inestead of all these separate files...

RickyBlender
21-Oct-11, 13:37
if you can have it in one file would be faster to read data
but not a problem i found a way to read all the files data anyway with different name

but still 93 sections X how many verts"
that looks well over 10 000 verts for one mesh model
still a lot of data to anim

is it possible to reduce or render time will be very long here and i mean hours but it can be done later on

let's try for the first model one to make it short and fast then we can increase qty verts and have a longer render time
that will save us a lot of PC time for rendering for now

later it can always be increase and wait for rendereing to get nice quality

what do you think

santasemilla
21-Oct-11, 14:04
Well, could you prepare exactly 1:1, that is 93 airfoils and 93 nodes? As I have written, the Blade tip is an extra "shape refinement" and will be fixed permanently to the last airfoil section (in this case - # 0093)...
There is another issue: look carefully at the input data from the post #63. It contains all the data you have originally placed in the separate files (not only the first lines, but also the coordinates). Could you prepare something like this?
Actual *Datapack* file from the post #65 is unusable for the script I have prepared...
I would propose to produce just a single data file for all sections, like in my example, inestead of all these separate files...

Hi Witold,

I know what you mean, but node 93 would be the tip of the blade and that is... just a point! There is nothing but a point defining the blade tip, that's why highest point of the Blade-tip curve corresponds to the last node. I get your point but.. if I have to assign something up there would be just one point [0,0, 61.5] or that point repeated 65 times (?!).

Sorry about the gluing, my bad for not looking carefully into your file. Now it is going to be only one .DAT file with everything. My apologies for the multi-files. That is something I'm used to do with my matlab codes as I need to treat things separately.

Well, I have the 3rd package ready. Let me know if you want 92 airfoils + bladetip ...or 93 airfoils where the last one is actually a point :s ;). Seriously, let me know. At this stage I know it works for generally testing the code.

Thanks!

santasemilla
21-Oct-11, 14:09
if you can have it in one file would be faster to read data
but not a problem i found a way to read all the files data anyway with different name

but still 93 sections X how many verts"
that looks well over 10 000 verts for one mesh model
still a lot of data to anim

is it possible to reduce or render time will be very long here and i mean hours but it can be done later on

let's try for the first model one to make it short and fast then we can increase qty verts and have a longer render time
that will save us a lot of PC time for rendering for now

later it can always be increase and wait for rendereing to get nice quality

what do you think

Ricky,

If you look at the figure in post #52, the only nodes that will have input data for the animation will be the red *. Yes, the corresponding cross-section will follow displacements and rotations from that node as a " rigid body". Nevertheless, if Blender needs to compute displacements and rotations for every point in the cross-section "skin", the total blade points would be (65x93) + 93 = 6138 ...is that too much?

santasemilla
21-Oct-11, 14:23
Anyway, here goes a 3rd attempt.

Now only one "_Datapak.dat" with all the info. This contains 92 airfoils + the blade tip. In case of needing 93 airfoils, just delete the blade tip and assign the
[0.0000000 0.0000000 61.5000000]


Let me know if this works, ;)

Thanks!!

158221

RickyBlender
21-Oct-11, 14:57
see data here

i cannot open it with py notepade+ to see line numbers

but i open it with txt notepad2 don't know why it is doing this !
but seems ok with notepa++!


so one file with 65 points per section X 93 sections= 6045 data points!

have to rework my file read to get this new data format !
read 65 then skip one line then read next section!

i prefer the first one easier to read more files then that

but i'll work on it


Witold Jaworski (http://blenderartists.org/forum/member.php?31311-Witold-Jaworski)

which one do you prefer ?

then can work on making the verts and face list to create a new primitive this weekend !



santasemilla (http://blenderartists.org/forum/member.php?105943-santasemilla)
will you check forum here this weekend in case we have questions!
is it possibl; to remove the file names for each section
have only pure data like 65 X93 and not other txt
make the file name with proper name for this blade and will use this has name!


thanks

RickyBlender
21-Oct-11, 15:41
ok i modified your last file zip and manually remove all the text line except the first line as title like the first zip file

and i can read it now i'l try to make the mesh and see how to make it !

hope i get the shape of prop this afternoon!LOL
or this weekend

thanks

Witold Jaworski
21-Oct-11, 15:48
Now only one "_Datapak.dat" with all the info. This contains 92 airfoils + the blade tip. In case of needing 93 airfoils, just delete the blade tip and assign the
[0.0000000 0.0000000 61.5000000]


Let me know if this works, ;)

This format is OK.
I will experiment with closing the mesh at the balde tip



have to rework my file read to get this new data format !
read 65 then skip one line then read next section!

i prefer the first one easier to read more files then that

but i'll work on it


Witold Jaworski (http://blenderartists.org/forum/member.php?31311-Witold-Jaworski)

which one do you prefer ?


I definitevly prefer a single data file - much more easier to maintain the data in the future



santasemilla (http://blenderartists.org/forum/member.php?105943-santasemilla)
will you check forum here this weekend in case we have questions!
is it possibl; to remove the file names for each section
have only pure data like 65 X93 and not other txt
make the file name with proper name for this blade and will use this has name!

It seems that we have conflict here: look at the code I have published: for me these lines are THE MOST IMPORTANT ones!
Do not remove them! Because in my procedure I have not assumed any fixed number of the airfoils and the data points, it is more general and flexible. I think that it will be important for ultimate user - santasemilla - to try freely different number of airfoils and their points, in the future.
(That's why I have stated the assumptions earlier: I have not assumed any fixed number in the input data!)

Ricky, do not be afraid of 10 000 faces! Such textured model renders in 5 seconds (or faster) per frame...

Well, I will publish here the next portion of the code, I have prepared, on Sunday. So you will be probably faster :eyebrowlift:.

RickyBlender
21-Oct-11, 16:20
well for the data txt lines i mean it is not needed for the data these lines are just remove
to make the array of verts

don't see why this is needed

as long as you now 63 point X 92 sections for the array then that's it we can make the mesh from theses verts data!

then you can change numbers of points or qty of section it does not matter !


unless you need sections with different numbers of verts !
but don't think it is the case here!

i was able to read the around 6000 verts from my modified file

i'll see if i can make the mesh faces today or tomorrow and be able to see the blade's shape for this windmill
but i remove for now the blade tip we'll see after how to finish the end tip here!

that should be very cool !


happy 2.6

Witold Jaworski
22-Oct-11, 07:11
Here is the next stage of solution:
This 158285 file contains a file named blade.blend.
Update the INPUT_FILE constant to point to your location of the data file (at the top of the code) and press the Run Script button
It loads the geometry and creates the mesh of the blade with all the vertex groups.

santasemilla, could you specify the "Blade tip" in different fashion: actually it is a single, open line of 65 vertices. This way it creates a need for additonal assumptions, which point of the last airfoil should be connected with a point of the blade tip.
I think, that it would be much better to specify it just as an airfoil section: as a *closed* loop. Concpetually: if you scale an airfoil along the Y axis to 0, you will obtain a straight line, which topologically is still a closed loop. Then bend it in the Z direction to the shape of the tooltip, and such a loop of 65 points which would be the best for the mesh making, because I can use the same algorithm for generating faces here, like for the rest of the blade.

Next step (after this weekend): automatic creation of the armature (bones), assigned to the blade.

RickyBlender
22-Oct-11, 09:34
nice work for the blade
i'm still trying to get all the sections in
first 2 are working but have to go ahead and see how it goes!

just in case in using vista need to change file name path line like this for local folder

INPUT_FILE = "C:\\Users\RJ\\0blend25\\00airfoilwindimill1\\witol d1\\NREL5MW_s46v23N51_Datapack.dat"

with double backslah then it will work nicely


santasemilla

how does it look like ?
is it what you wanted ?

see top view here
it looks like the sections are not equal lenght
is it ok ?



158302

RickyBlender
22-Oct-11, 09:53
santasemilla

wondering something here

1 - Airplane prop are twisted along main axis which is not the case here
so is this ok ?

2 Scale for blender
if you look at the precision for vert location we are at something like 0.001
is this good enough or need to get more digits after the dot like 4 or 5 digits ?
cause you file seems to have higher precision then 3 digits !

3-



Witold Jaworski (http://blenderartists.org/forum/member.php?31311-Witold-Jaworski)

it would be interesting to see if there is a way to do this with spline circle and extrude along main axis
no need to do the faces only verts - auto skinning !

Witold Jaworski
22-Oct-11, 13:22
...
it would be interesting to see if there is a way to do this with spline circle and extrude along main axis
no need to do the faces only verts - auto skinning !


Yes, I think that it is also possible to draw the first section, then extrude it, and then to change its vertices cooridinates to set it to the shape of the next section.
It is just an alternative way. Probably its code would have similar (or little more) complexity. From the practical side, as long as the execution time of the current code is acceptable, as the results it produces, there is no special need to work on such alternatives.

RickyBlender
22-Oct-11, 13:40
don't know still wondering if we don't have too many sections i mean 93 is a lot of sections

but it's definitively the most high res prop i'v ever seen done yet !

it looks super nice

would like to do this for old plane prop like b17 or b24!

santasemilla
22-Oct-11, 15:44
Hi Ricky, Witold,

First, the blade looks very good from the picture Ricky posted! Great job! I'm not in my computer right now but as soon as I can I'll try it myself.

Witold, I understand the blade tip issue. My idea was (and sorry to assume it could be understood from just seen it) to connect that open curve I named blade-tip to the nose and tail points of airfoil #92. That's why the number of points for the airfoil were odd (65), to ensure a point at the nose. This was my original thought. Now,as you say, it would be much easier an "airfoil" for the tip, what I can do is just, instead of assuming a point at the blade tip, let's assume a small segment (no blade ends at a point in the real life) so, I'll make a segment let's say 10cm long divided into 64 (65 points) and position it at the very end of the blade. This will be easy as the blade at the tip has zero twist so... just a segment and that's it. There will be no even need to bend it in Z. If I bend it... l would say let's use the blade tip that we have now and get the two ends as the nose and tail of a freak line-type airfoil! ;) I'll do the small segment as soon as I can.

Ricky, couple of things. I haven't had the chance to look at the blender file by now, but the blade should be lightly twisted. The twist at the root should be ~ 13[deg] and 0[deg] at the tip. So yes, it's not like an airplane propeller, but it should have twist. Now, 93 sections could be a lot, yes, but it's fine and I can tell you it is a coarse mesh compared to others I have. ;) Regarding the spline technique, yes, it would be nice to try it. As Witold said, I'm using kind of that process in matlab to get all the intermediate blade sections. The difference is that I don't use splines, I use hermite interpolation polynomials combine with other things in order to get a smooth result (blade external shape and also internal structures that I'm not porting to Blender). By using only spline you could end up with a bumpy surface as splines tend to produce overshoots at some points.

Well, as soon as I'll get in my computer, I'll try the blade and I'll work on the little segment tor the blade tip

Thanks a lot guys!

RickyBlender
22-Oct-11, 16:16
santasemilla


sorry but a few more questions here

1 - Frames for animation
how many frames do you intend to do for the animation?
i mean we can use Key framing every few seconds and eveything in between is interpolated by blender
or do frame by frame which means 24 frames per second but that would be very tedious

hope we can do it with keyframe would be a lot easier here !

2 - when do you expect to have the datas for the bones or section rotation and translation per keyframe


3 - i have to say that in blender we use Bspline or Nurbs and did not see any overshoot
i touhgt that Bspline where the best interpol algo available on market !


4 - and in December we will have the new sort of T spline with new Nurb tools
so it's gone be fun with the next release of blender near christmas !

5 - You say you find this coarse mesh with 64 segment per section! WOW
i mean if you apply smooth to it you cannot tell the difference !
you could have use 32 segments per section with smooth and may be at most apply a subsurf to it
and voila super smooth!

but if your happy with it no problems man

most of the time i don't use super high res mesh like we did here
the minimum mesh with smooth is the best and fastest in blender !
may be add a subsurf modifier to it to get smoother edges



6 - Precision as i said
do you require more then 3 digits of precision after the dot like 0.001
or is it ok with you!



don't forget blender is not a CAD soft its'more general modelisation and not function of the exact precision usually
so depends what you need as precision here!



thanks for your clarifications
we keep moving foward

RickyBlender
22-Oct-11, 17:22
found some snippet for vertex group

that might be usefull for the rig








Object with some vertex group

import bpy
def listVertexGroups(ob):
if not (ob and ob.type == 'MESH'):
print("Not a mesh: %s" % ob)
return

me = ob.data
vertGroups = {}
for vgrp in ob.vertex_groups:
vlist = []
for v in me.vertices:
for vg in v.groups:
if vg.group == vgrp.index:
vlist.append((v.index, vg.weight))
vertGroups[vgrp.name] = vlist
return vertGroups

vertGroups = listVertexGroups(bpy.context.object)

for (key, value) in vertGroups.items():
print(key, value)
adding vertex to vertex group
import bpy
vgroup=[0,1,4] # Vertex n° 0 1 and 4
obj = bpy.context.object
Group = obj.vertex_groups.new('SeaLevel')
Group.add(vgroup, 1.0, 'ADD')

Vertex Group

import bpy

def listVertexGroups(ob):
if not (ob and ob.type == 'MESH'):
print("Not a mesh: %s" % ob)
return

me = ob.data
vertGroups = {}
for vgrp in ob.vertex_groups:
vlist = []
for v in me.vertices:
for vg in v.groups:
if vg.group == vgrp.index:
vlist.append((v.index, vg.weight))
vertGroups[vgrp.name] = vlist
return vertGroups

vertGroups = listVertexGroups(bpy.context.object)
for (key, value) in vertGroups.items():
print(key, value)


from code snippet PDF book rigged mesh snippet

def skinMesh(ob, rig):

# List of vertex groups, in the form (vertex, weight)
vgroups = {}
vgroups['Base'] = [
(0, 1.0), (1, 1.0), (2, 1.0), (3, 1.0),
(4, 0.5), (5, 0.5), (6, 0.5), (7, 0.5)]
vgroups['Mid'] = [
(4, 0.5), (5, 0.5), (6, 0.5), (7, 0.5),
(8, 1.0), (9, 1.0), (10, 1.0), (11, 1.0)]
vgroups['Tip'] = [(12, 1.0), (13, 1.0), (14, 1.0), (15, 1.0)]
15
# Create vertex groups, and add verts and weights
# First arg in assignment is a list, can assign several verts at once

for name in vgroups.keys():
grp = ob.vertex_groups.new(name)

for (v, w) in vgroups[name]:
grp.add([v], w, 'REPLACE')

# Give mesh object an armature modifier, using vertex groups but
# not envelopes

mod = ob.modifiers.new('MyRigModif', 'ARMATURE')
mod.object = rig
mod.use_bone_envelopes = False
mod.use_vertex_groups = True

return





this should hep do the verts group

but need to set an auto naming for each berts broup per bone

mind it can probably be done while defininf the bones's name
and simply add another name for bvertroup for that bone

i'll be back with this snippet

RickyBlender
22-Oct-11, 17:44
here is beginning of a snippet for naming bones section and bone verts group

i appended names to an array so it can be use in other functions

it might be one way to do it




#----------------------------------------------------------
# File rigged_blade2.py
#----------------------------------------------------------

# How to find luck again and keep it ?

import bpy, mathutils


vgpname=[]

bname1=[]



def createArmature(origin):

global vgpname,bname1

# Create armature and object

# amt = bpy.data.armatures.new('MyRigData')
# rig = bpy.data.objects.new('MyRig', amt)


amt = bpy.data.armatures.new('Arma_windmillblade1')
rig = bpy.data.objects.new('Rigwindmill', amt)

rig.location = origin
rig.show_x_ray = True
amt.show_names = True


# Link object to scene

scn = bpy.context.scene
scn.objects.link(rig)
scn.objects.active = rig
scn.update()


# Create bones # Need 20 sections = bones

bonename="Bonesection-"
bname="Bname-"
seq=0

for i in range(1,5):

nam=bonename+str(seq)
nam1=bname+str(seq)

bname1.append(nam1)

print ('Bone [',i,'] =',nam)
print ('Bone name [',i,'] =',nam1)


# Add name for vertgroup

nb="Vgroup_"+nam1
vgpname.append(nb)

print ('Bone Vgroup name [',i,'] =',nb)



bpy.ops.object.mode_set(mode='EDIT')

nam1 = amt.edit_bones.new(bonename)

nam1.head = (0,0,seq)
nam1.tail = (0,0,seq+1)

print ('Bone name =',nam1)
print ('Bone name =',nam1.head)
print ('Bone loca =',nam1.tail)

print ()

seq+=1

bpy.ops.object.mode_set(mode='OBJECT')

print ()
print ('Bones names =',bname1)
print ()
print ('Bones verts group names =',vgpname)



return rig





Just run the script and look into the console
will show all bones names and bert group name

but then need to assign these to vert group

or might be auto way to assign these vert group

let me know what you think

RickyBlender
22-Oct-11, 18:05
Witold,

got an idea here

in you script when you model the blade's shape

when you define each section you could also assign the verts and verts weight to a group
so that would be done at the same time and give an appropriate name may be!

but then what would be a group is it only the center of the section of beginning and end of the section?

santasemilla
23-Oct-11, 00:20
Hi Ricky,

Here around again, so let's go answer your questions.

First of all, I saw the blade and it looks GREAT! I have no words to thank you guys for this hard work. It's incredible but, after so many years working on this project from the math and physics points of view, getting to play with a 3D model now is super descriptive!

Ok, to the questions:


1 - Frames for animation
how many frames do you intend to do for the animation?
i mean we can use Key framing every few seconds and eveything in between is interpolated by blender
or do frame by frame which means 24 frames per second but that would be very tedious

hope we can do it with keyframe would be a lot easier here !For the differential equations I solve for the time marching problem I obtain results on a non regular time frame. What I mean is that I'll have sets of results for, lets say, 0s, 0.3s, 0.41, 0.83, 1.22, ...blah blah blah. This is because of the nature of the solver. It adapts the timestep to ensure, let's say, precision in the solution. So the answer is yes, I totally believe Key framing will be the correct method to use. Actually, the "loading" of the data would be similar to the loading of geometrical data for the blade model. The difference is that in this case, we will assign displacements and rotations for the nodes of the blade axis.


2 - when do you expect to have the datas for the bones or section rotation and translation per keyframeI already have some data, but I need time to process it the way I processed the airfoil shapes for the blade model. I mean, I wanted to see this modeling part first to see how to provide you guys with the data. For example, now I'm thinking that I'll probably post one big file (text file, similar as before) but with identification lines for the specific timesetp, and after that, the data in kind of a 93x6 matrix. Before was 65x3, 65points, XYZ coord. Now will be 93points, Ux Uy Uz Wx Wy Wz, where U will be displacements and W rotations. ...but just thinking by now, we need to discuss that later. Also, as Witold said, don't take it literal the 65points we have now for the airfoils neither the 93 for the axis. That needs to be flexible as I also vary the complexity of the meshes I use for different problems.


3 - i have to say that in blender we use Bspline or Nurbs and did not see any overshoot
i touhgt that Bspline where the best interpol algo available on market !


4 - and in December we will have the new sort of T spline with new Nurb tools
so it's gone be fun with the next release of blender near christmas !

5 - You say you find this coarse mesh with 64 segment per section! WOW
i mean if you apply smooth to it you cannot tell the difference !
you could have use 32 segments per section with smooth and may be at most apply a subsurf to it
and voila super smooth!Yes, you are right with what you say and you maybe have to be a bit patient with me as I'm coming from another world, a numerist and engineering world. When I talked about splines and overshooting I was talking about interpolating complex functions numerically. Also, the overshoots may occur when you compute derivatives over interpolated functions with splines no matter the original function looks super smooth! But yes, I just mentioned that I could also used splines for the "blade morphing" as Witold guessed, but no. Anyway, for the sake of this 3D model and animation, we can perfectly use splines and way less points if it looks good. This is just a representation, something that needs to help interpreting the many plots produced by the many variables playing in this problem. ;)



do you require more then 3 digits of precision after the dot like 0.001
or is it ok with you!3 digits for what we are doing it's super fine. No matter my data have 16 digits, that's a numerical solution and it's worth for other purposes. Practically for this Blender project, if we are talking about a 61.5m long blade, and I pretend to represent a displacement in the animation with less than 1mm... I'm nuts!


don't forget blender is not a CAD soft it's more general modelisation and not function of the exact precision usually
so depends what you need as precision here!Yeah, you are totally right, I understand that. Also, it is more evident that I need to get time I don't know out of where, but I need to get more familiar with Blender as soon as possible! hehe.

Thank you very much Ricly!

Witold Jaworski
23-Oct-11, 08:41
Witold,

got an idea here

in you script when you model the blade's shape

when you define each section you could also assign the verts and verts weight to a group
so that would be done at the same time and give an appropriate name may be!

but then what would be a group is it only the center of the section of beginning and end of the section?

Ricky, I have already assigned the proper vertex groups in the script presented blade-002.zip!
(in the post #75) Just look at it!
Their centers are in the points declared in the "Axis Coordinates" section. That's why we will put the bones in theses points.

Witold Jaworski
23-Oct-11, 08:55
santasemilla
6 - Precision as i said
do you require more then 3 digits of precision after the dot like 0.001
or is it ok with you!


Ricky, 3 digits it is the precison used by Blender to display the values!
When you examine (using the Python API) the first vertex of the first section, for example, you will receive:
Vector((0.8153175115585327, 1.675885796546936, 0.0))

Comparing it with the input data:

0.8153175 1.6758858 0.0000000

gives the conclusion, that the difference in precision may happend at the last digit, i.e. is about 0.00000001

I think that internally Blender stores the floating-point numbers in 32-bit floats, because of the speed of calculations (at least on 32-bit processors).

RickyBlender
23-Oct-11, 09:22
Witold,

if you have any confirmation on the precision more then 7 Digits let me know
cause i ask question a few times and nobody was able to say that internally it is more then 7 digits
but wish it was more !

i mean python runs with at least 15 digits i think but not internal blender as i know of this was not changed in 2.6!

sorry i did not have time to ananlyse your little script so if you already have given nanes to verts group it is nice

i'll try to look at your script today later on

RickyBlender
23-Oct-11, 10:55
santasemilla

sorry but this discussion is needed to get the right data where it should be!


and your right we need to talk a little about rotation in space in blender
your data needs to be clear of what rotation math it is !

so here is a quick intro to blender rotation nightmare






First of all Blender is using a right handed coordinates system.
and rotation with righ hand rule

but it is backward the + Y is going backward in the screen not out of the screen look at the widget in viewport !

158410
Rotation of object in blender

In blender we can use 3 different scheme to rotate objects
Rotation with Axis angles
Rotation in 3D can be represented by a unit vector and an angle of rotation about the axis of a 3D
vector.
The main disavantages are that we cannot directly combine two rotations to give an equivalent total
rotation and there are two singularities at 0° and 180° where the axis can jump suddenly for a small
angle variation as input.

Euler angles

Euler angles refer to the fact that we can represent the 3D angle with 3 seperate angles of rotation
Like rotation around X axis Y axis and Z axis.
This would at first seem a naturel way to deal with 3D angle by using Euler angles or 3 seperate
angles but in reality this can lead to many problems when doing calculations.
Combining Rotation angles order
We could represent the order as follows
xyz, yzx, zxy or reversing the order zyx, xzy, yxz which gives 6 permutations.
Now the angles are not independent for instance rotating X 90° followed by Y 90° and back X-90° is
the same as a single rotation of Z 90°.
This means that we can also use any of the following sequences: xyx, xzx, yxy, yzy, zxz and zyz.
In total we end up with 12 possible angle sequences
We could also measure these rotation relative to the World or to the object in local mode which
means we have a total or 24 possibilities.


Quaternion angles

Transformation Matrices.
Each object keeps the Location, Rotation and Scale in a 4 X 4 matrix called a transformation matrix.
The content of this matrix are shown in the N transform panel and in object mode it shows the location,
rotation and scale of the object.

Parent / child objects
Reference
See Magasine #30 article on parent and child matrix

Matrix Local and World

The matrix_global will always represent the transformation relatively to the global coordinate system ignoring any parent-child relation.
The matrix_local represents the object's transformation relatively to it's current coordinate system.
if you parent an object to another object, it'll become a member of the parents coordinate system meaning the matrix_local will represent the transformation from the parent's origin.

example of matrix rotation which is really quaternion rotation here

Matrix Rotation / Inverse and Transpose
to learn more about this see
http://blenderartists.org/forum/showthread.php?t=201937&p=1736294#post1736294


here is sample example on how to rotate around a specific vector

Rotate Vector

import Mathutils as m

angle = 30
vector = m.Vector(2,3,0)
axis = m.Vector(1,1,4)

newVector = vector * m.RotationMatrix(angle,3,"r",axis)

sorry it is a long description but rotation in 3D world is a difficult subject!

and needed to be done so we can speak the same math language here and you understand what blender can do


so the big question here is how do your represent your 3D angles in space
is it like euler angle or quaternions or else?


thanks
happy 2.6

Witold Jaworski
24-Oct-11, 11:10
As I have promised, this 158512 file contains the next version of the blender file with the script. Usage - like the previous version.

It creates the blade and its armature (bones).
All bones are assigned to proper airfoil sections.

The only missing thing is the blade tip (that's why you can see the last bone, at the end of the blade).

Ricky's question about the way of specifiing roatation remains valid. Personally I had a good experience with quaternions - they do not require additional assumptions about the "application order", like the Euler angles....

RickyBlender
24-Oct-11, 11:49
well i think we have to know what angles he is going to use if the animation is going to be realist

i hope he has a good 3D mind cause this is not an easy subject
and i know that many peoples have problems grasping this rot thing in 3D it's a lot more complicited then with 2D which is very easy to understand and do


did you look at the pose snippet i think this one contains the info we need for anim with keyframe i think

salutations

RickyBlender
24-Oct-11, 12:49
thanks for this one
tried you last file nice i can see the armature added which is nice looking

suggestion
can you add a version number to all your scripts , files
would be easier to follow which version we are using

also is there a way to add a color for these bones and set up X ray to see it through the blade
cause i had problem finding the armature in this very dense mesh
i could not see it at first !LOL


nicce work man

now hope we get the proper angles for the bones !


on point here for the first bone at bottom near zero

is the zero at the base of in midlle of hub ?

and did you use the axis datas given to set the bones lcoation or only approximative for now?


thanks

RickyBlender
24-Oct-11, 17:03
ok got s trange behavior here

i can remove longitudinal loops line

but i cannot do it for vertical loop line?

any idea why it is so or is this a new bug ?

tested in latest SVN today and earlier version

found something here

the mesh contains extra verts wich are not required on the small edge and making extra faces with diagonal which is stopping the loop delete!


thanks

RickyBlender
24-Oct-11, 18:21
santasemilla


sorry to ask again but i lost the reference !

what is this link you gave me for NACA blades?

would like to try to make 3D model if possible

thanks

santasemilla
24-Oct-11, 22:38
santasemilla


sorry to ask again but i lost the reference !

what is this link you gave me for NACA blades?

would like to try to make 3D model if possible

thanks

Here Ricky: http://www.ae.illinois.edu/m-selig/ads/coord_database.html

Not only NACA but a lot more and I guess some coefficients too somewhere.

santasemilla
24-Oct-11, 23:04
Ricky, Witold,

Sorry but I've been getting the comments during the day but got some time to write something here now.

The BIG and important question: ROTATION ANGLES! Don't worry, I understand what you are talking about Ricky. Nevertheless the rotations I'll have are very small, sometimes as small as 0.01 [deg] or sometimes less The most important rotation the blade has is already there, the initial twist for this case. The instantaneous rotations added will be small. You may know that when angles get so small, you can add them regardless of the order and the error is not much. As I said before, let's don't loose the focus here and remember that this animation will be just a representation. Nevertheless, I think I can provide you with the instantaneous rotation 3D matrices for each node at each time-step. If this matrices take a lot of time for me to extract from the solution process and for you to implement in this animation, we'll need to try the addition. Also, I'll check how the matrices are made. You know that rotation matrices have the order implicit...so if I go back in my notes and recover the order, the Euler method won't be too bad neither.

Again, I'm having lot's of work to be done in other fields! Sorry guys I really appreciate your interest and hard work here, but sometimes I can not get the pace!

My to-do list:

- Provide Witold with a blade-tip. (Actually we said it was going to be "the chord" of the last airfoil, right? So for this case there will be 92+tip? or 93 and we don't call it tip any more? Sorry Witold, I can't remember now. Do you need the blade-tip to exist yes or yes in your code? If that's the case, I'll do the 92+tip.)

- I'll get so process some dynamic data and make a new pack.

In the future, my Blender exercises will be to make a hub, a tower, a nacelle, triplicate the blades, animate the rotation of the whole turbine! Uffff... enough! :)

Ah, Ricky, I think I read your question somewhere: The blade root connects to the hub with a flange.The hub looks like this:

158585

Thanks again guys! Take care.
Santasemilla

Witold Jaworski
25-Oct-11, 02:27
....
My to-do list:

- Provide Witold with a blade-tip. (Actually we said it was going to be "the chord" of the last airfoil, right? So for this case there will be 92+tip? or 93 and we don't call it tip any more? Sorry Witold, I can't remember now. Do you need the blade-tip to exist yes or yes in your code? If that's the case, I'll do the 92+tip.)


The "Blade tip" entry remains. It should contain a closed loop of points (like the last airfoil). Script will build the faces that connect it to the last airfoil section (in the example we have, it is the section #92). The algorithm is simple: connect nth point of the airfoil section with the nth point of the blade tip. Script will also create additional faces to close the space inside the blade tip loop. (If it is so thin that they occupy the same point in the space - do not worry, it they will be joined later on). This way we are avoiding some additional assumptions, like "which point is the nose point of the section", and so on.
This connection will be "stiff", i.e. the blade tip will belong to the same bone as the last airfoil section.

BTW: If the blade is defined by N airfoils (+ the blade tip), The "Axis coordinates" section should always conatin N+1 points, like in the current data. I have found this last point very useful in definining the armature for this object (This [N+1] point of the axis defines the tip of the last, [N] bone)

RickyBlender
25-Oct-11, 10:07
i did find a very old thread on airfoil
http://blenderartists.org/forum/showthread.php?9521-naca-4-digit-airfoil-plotter

so first need to be ported to 2.6 and not certain yet wht it can do !

but i think i'v seen antoher one last year for 2.5 but have to locate it
if i find it i'll let you know


thanks

RickyBlender
25-Oct-11, 10:09
i can make a new primitive for the hub then it an be added to the blade and add the missing part to complte a whole triple airfoil!

what do you think ?


salutations

Witold Jaworski
25-Oct-11, 14:44
found something here

the mesh contains extra verts wich are not required on the small edge and making extra faces with diagonal which is stopping the loop delete!


It was an error - missing condition in the assign_face() procedure
Fixed version of the file: 158664

About modelling the rest of the turbine: it is possible, but usually the deformation of the blades is better visible when they do not rotate - and they are usually present on the example of a single blade...

BTW, santasemilla: could you examine the shape of the blade we produced in Blender?
The thickness of the trailing edge, and its shape, seems to weave a little - it looks that some sections are too thick. It is not visible at the first glance, but is becoming evident when you look at it along the axis... Is it an interpolation error?

RickyBlender
25-Oct-11, 15:25
rotation 3 blades mdoel would not be part of the model we work on right now
only after we get the whole thing done
like an extra thing

right now we need to know what kind of angles we gone get for the bones is it euler aboslute or euler relative ?
i mean if we keep armature ik chain then we need to work with relative angles compared to the bone before it

if no ik chain then we can use absolute angle values for each bone independant of all other bones
then the blender will generate whatever frames is needed between keyframes


right now in latest file you did not add the Ik chain
so bones should use absolute angle values !



have fun with the wind

RickyBlender
25-Oct-11, 15:35
a few notes here

rename blender file like blade4
and i also had to rename script filename blade4.py


also are you working on vista 32 bits?

can you add new line for path like

#INPUT_FILE = "C:\\Users\RJ\\0blend25\\00airfoilwindimill1\\witol d1\\NREL5MW_s46v23N51_Datapack.dat"


just to show how the path line is set up to work fine on vista and with SVN!
using \\ instead of single \!

cause it wont read file on SVN for windows

sorry but not everyone knows how to set up these file path on windows for SVN!


and where does the first bone goes ?
is it where it is or in the middle of the hub ?




thanks

RickyBlender
25-Oct-11, 18:59
new distance ?

Witold Jaworski
26-Oct-11, 02:46
right now in latest file you did not add the Ik chain
so bones should use absolute angle values !

Exactly!
Because:


(...) my displacements and rotations are reported referred to a global coordinate system. (...)





rename blender file like blade4
and i also had to rename script filename blade4.py

also are you working on vista 32 bits?

can you add new line for path like

#INPUT_FILE = "C:\\Users\RJ\\0blend25\\00airfoilwindimill1\\witol d1\\NREL5MW_s46v23N51_Datapack.dat"

just to show how the path line is set up to work fine on vista and with SVN!
using \\ instead of single \!

I am using Windows XP. OK, the next file will be named blade5.blend, the next blade6.blend, and so on, and I will use the double backslash in the path string.



and where does the first bone goes ?
is it where it is or in the middle of the hub ?


The bones are placed in the locations specified by the "Axis Coordinates" section of the input data. I expect that the base for the blade dimensions is its first airfoil (a perfect circle, BTW).

RickyBlender
26-Oct-11, 07:57
with global you can still be absolute or relative !

problem is that we don't see the whole hub or even the hub's middle only a fraction of it !
usually radius distance is from middle of the hub not the blade's root

158736

santasemilla

can you tell us which distance you are using see pic i uploaded in post 103

and about angle that do you think it is going to be relative or absolute and local or global ?

RickyBlender
26-Oct-11, 08:54
santasemilla


can you give us some education here on windmills in general

1 - is there an approximative equations giving the power output in KW VS the blade radius may be?

i saw a graph showing the power function of a power law (a=1/7)


2 - usually we have the blades' rotor runing at relatively low speed
what is the usual range here in RPM?

3 - Generators
there is usualy a gearbox between blade's rotor and the generator
are these generators standard or especially built for this application ?
like for a 1 Megawatts windmill is the generator speed like 900 or 1800 RPM?
what is the usual gearbox ratio here ?

4 - is the blade's rotor speed also function of the size may be?


thanks for any info

santasemilla
26-Oct-11, 14:01
new distance ?

Haha, you are going fast man! For this case we are working on, hub radius is 1.5m. So "distance from hub center" = 61.5m +1.5m = 63m.

I don't know what you mean by Distance from Blade base. Are you pointing the nacelle to blade tip distance? If so, don't pay attention to that. Nacelles are all different and what you have to care of is the rotor, (blade+hub) ;)

A couple of tips as you are working here on this: For the case we are talking about, tower height should be 90m. If you look at the whole turbine from the side, you should have a clearance distance between tower to rotor disk. That' s 5m.

Constructively there should be also two more angles considered for this case. The rotor is pre-conned to the front with 2.5deg. and the whole turbine is tilted up 5deg. The center of rotation for this tilt is the connection between tower and and nacelle. ;)

Talk to you later

RickyBlender
26-Oct-11, 14:29
distance

i was thinking about the root of first bone where does it have to be located ?
is it where you can see it blend file near blade's base
or in the center of the hub which we don't really have right now!

this is needed so that we have precise bone rotation !

hope you see what i mean here see my drawing!

did find one site giving some gen equations to approximate power for windmill
but overall efficiency seems to be between 10 to 30 % which is very poor i guess




saluations

RickyBlender
26-Oct-11, 14:55
Witold,


did you see script to select file in window

might be an improvement

http://blenderartists.org/forum/showthread.php?164765-Scripting-examples-for-2.5-update-Mar-26th-2010&p=1975109#post1975109

post 414

happy 2.6

RickyBlender
27-Oct-11, 10:49
did you begin to look at the anim part with pose script for the frame animation?

would like to start the basic set up for this and do some testing to see what it gives
even by using fake rotations values just to see how it goes

happy 2.6

Witold Jaworski
27-Oct-11, 14:12
I have just analysed the script that inserts keyframes and rotations for the bones, from the "Python snippets" book. Still have some details to check.
Feel free to experiment yourself :). I prefer to wait for the real input data.

RickyBlender
27-Oct-11, 14:22
last file with armature

bone name seems to be like a sequence of number like 001 is it right ?

thanks

Witold Jaworski
27-Oct-11, 14:36
Yes, it is the symbol of the section, read from the header of the airfoil data (it can also be alphanumeric, if such symbol will appear in the input file).

RickyBlender
27-Oct-11, 14:46
and you did not yet assign the vertex group to the bone

i'll try to make the new vert group and see if i can get a minimum anim to work with a few bones only

at least i'll know if it works ok with this IPO curve but have to find how this ipo curves works for rotation


thanks

Witold Jaworski
27-Oct-11, 14:50
and you did not yet assign the vertex group to the bone

i'll try to make the new vert group and see if i can get a minimum anim to work with a few bones only

at least i'll know if it works ok with this IPO curve but have to find how this ipo curves works for rotation


thanks

Ricky, you do not need to make any special assignment of the vertex groups!
Blender matches them with the bones by name!
Just load the blade, switch into the pose mode and rotate or move any bone - you will see that it moves the corresponding airfoil!

RickyBlender
27-Oct-11, 14:58
ok but we don't see any verts group defined

how do you know it is activated ?

did test and seems to stretch the blade already for bone 0 only

but not the other bones any reason for this ?

nice to see it work



thanks

Witold Jaworski
27-Oct-11, 15:38
ok but we don't see any verts group defined

how do you know it is activated ?

did test and seems to stretch the blade already for bone 0 only

but not the other bones any reason for this ?

nice to see it work



thanks

1. There ARE vertex groups in this mesh (See in its Object Data property group, Vertex Group panel)
2. Bones are NOT connected to each other: each of them moves its airfoil, only. This is because I expect that the input data will contain global transformation and rotations, as I have written before.

RickyBlender
27-Oct-11, 15:52
ok can see the group

i tough there was somewhow a way to see the groups when the armature is selected too

guess you have to be in vertex paint mode for that !


not certain if this will work fin and easy to do !

here's another tough

for the anim

if there is not IK chain it means that the bones are not connected
so for each frame key it means you have to recalculate each bones root and tip rotation and translation
that could be very tedious ?

what do you think ?

don't know if santasemilla,
can tell us if the bone's rotation are on the euler axis Z Y and Z or only aorund Z axis for instance
i assume that the translation will be X and Y but because of rotation if more then one axis then it will change also in Z!

and if not connected no IK chain not certain blender can interpolate the bone's rotation and location for other frames in between !



thanks

Witold Jaworski
27-Oct-11, 15:55
You do not need any IK when the translation and roatation of each bone is given explicite, as in this case.

Witold Jaworski
27-Oct-11, 16:20
don't know if santasemilla,
can tell us if the bone's rotation are on the euler axis Z Y and Z or only aorund Z axis for instance
i assume that the translation will be X and Y but because of rotation if more then one axis then it will change also in Z!


It was said, that translations wil be in all three dimensions, and the rotation will be also in 3D. Do not worry, I am quite certain that santasemilla will deliver us the data in acceptable form. There is no special magic in switching the rotation values from Euler to a matrix or an Quaternion, and back, even for a somebody that has the Master degree in mechanics, not speaking about the PhD :).

RickyBlender
27-Oct-11, 16:28
we already have script snippet to do the conversion bewtween different rotation representation
and angle delta is less then 360 so i don't expect any problem for this!

it is more the how to for the little animaton with frames that i'm trying to see how to get it going !
with no ik chain

i got a script beginning to work like the pose one

and not so good so far
like i can change the first bone rotation but then all the other bones loose their vgroup and dont' work anymore!

have oo work some more to better understand why it is doing that !

salutations

RickyBlender
28-Oct-11, 15:48
i modified the pose snippet and able to modify the angle of 2 bones on the big blade armature with 93 sections!

but have to find a better way to control the names of bones and set angle value that make sense

but seems its' working ok

in summary we need this

1- Insert let say 10 keyframes equivalent to IKframe depends on animation lenght
2- Number of rotation FCurves Here we need 93 bones Fcurves + 93 location Fcurves
# Last keyframe will be outside animation range

3- Then for each IKframe we need to set the 93 bones rotation and location

sorry did a mistake on calcualtions here late yesterday!

for each key frame we got let # rotations + 2 lox parameters
so this makes 5 IPO curve per bones

5 X 93 =465 IPO curves / frames
so if we have 5 IKframes then this gives around 2,325 points to enter

RickyBlender
01-Nov-11, 09:27
santasemilla

blades' shape

see pic here it looks that some blades may are rounded but your model did not seems to be like that
is that normal ?

159311

thanks