2020-50 LTH Tutorials: Running CFD Wind Tunnel Analysis of a Grasshopper with Grasshopper

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Thank you for being the best. Love your content!

👍︎︎ 1 👤︎︎ u/pseudonym_B 📅︎︎ Dec 30 2020 🗫︎ replies
Captions
[Music] hello hello hello and welcome to tutorial number 50 the final one of the year finally so for this special occasion i guess we're going to look at fluid dynamics and how can we simulate them in grasshopper so we're going to use this little guy that's rotating on the screen as our test subject and we're going to just see what kind of wind drag it makes in the wind tunnel so there are options on what kind of software we could use or rather what kind of plugins we could use uh there's rhino cfd and similar plugins to that but all of them are quite expensive so once we limit our budget to zero because we like not paying money uh we're only left with two choices basically a plug-in called swift and the plug-in called butterfly of course both available for grasshopper both of them are free and i just decided to use butterfly so why the heck not right so this is going to be something a little bit harsher in terms of ins installing and also it's going to be a little bit harder for me to explain what the different components do but let's give it a try so without any further ado uh let us look at where you can get butterfly so again as per usual in foot for i know if you search for ladybug tools and you scroll down then here you can see there's butterfly 0.0.05 release which uses blue computational fluid dynamics core so this is like open open source core of course grasshopper in itself can't compute cfd models so we need to use an external core which makes installing of this kind of plug-in a little bit more difficult than your usual plug-ins usual grasshopper plug-ins so basically you need to download this butterfly 0.005 and also you need to go to this website here that's listed here github.com ladybug tools but flywiki once you open up that website this is what you're going to see right and here you basically care about two links on this website one is called installing blue cfd core so we we open up that one and the other one is installing butterfly we'll open up that one so in terms of blue cfd core all you need to do is just blah blah read through this which can be downloaded from this page you click on this link right here you go deeper into github basically but you just need to download this little guy right here and by little i mean 790 megabytes whatever you just download it it's going to install and you'll have the core available the only drawback of this particular software um or this particular particular core is that right now since i have it installed every time when i right click my trash bin it asks me would i like to open it in blue cfd core terminal which i hate but you get used to it other than that it's uh it doesn't cost a lot um so let's come back here so you let's say you've installed the blue cld core then you just and you have butterfly downloaded then you just followed the the steps in the second link that we opened called installing butterfly you just follow those steps um you basically just run the installer.gh file set the set it to true and it's going to install you know it's going to install the butterfly plugin once you're done that you're good to go you're ready so let's stop stop rotating why are you oh right turntable so then you just jump into into rhino let's change the view to shaded and you get some sort of a mesh don't or or any kind of form so here i'm using a grasshopper to you know to to test out things and to test out how things are work uh working but basically you can just make a cube right make a cube if you want to be fancy you can just bully and difference out something from that cube like that and that's good enough for uh for an initial test actually yeah let's do let's do this later like let's do the grasshopper part later uh let's work with a cube first right so that all of you can follow along so this cube right here let me actually rotate it as well this cube right here uh is going to be something that's placed in the wind tunnel right so it's inside of a wind tunnel and wind is blowing uh along the y direction so along this green line and it's creating some sort of drag some sort of wind turbulence you know there's there's a lot of dynamics going on we're going to simulate that and analyze that right before we start butterfly works in meters not in millimeters so make sure that you go to units enter you type in units you hit enter you go to model units and you change to meters if you work in millimeters is going to be a mess right and in meters the size of my cube is basically 11 meters high 17 meters wide 17 meters deep right so it's not a cube of course but uh this is just so that you know the the basic sizes right off of the thing [Music] then you open up grasshopper and you start start building up your script so this is uh my notes basically if i get stuck i will take a look at them and trust me i will be taking a look at them because there's a lot of things that i don't necessarily know about butterfly but i do know the basics and i'll try to guide you through them so first things first we need to reference in our box here right so let's do that we will be using a node called geometry in this case because i want to be able to reference either a b rep or a mesh without having to do any kind of discrimination between the two types of geometries right so in this case this is a b-rep set one geometry there we go so geometry node right uh perhaps i should do this draw icons off there we go this should be better let me hide [Music] the geometry in rhino so that is only left in grasshopper and continue working with that let me just quickly check oh i guess we can immediately go to yeah we can immediately start working with within butterfly so here in the butterfly tab uh first things the first thing that we do is we create uh create a case for for butterfly to solve right so we so basically we start from create tab and we find butterfly crate butterfly geometry [Music] i think or is it butterfly crate case from geometry we'll see let's add both of them and we'll see which one is the correct one name geometry boundary okay so it's not this one it's not case from geometries it's just create butterfly geometry so i'm going to delete that one and for now i'm just going to use create butterfly geometry so it let's go through the inputs it asks us for what kind of name will we give it so i will just create a panel slash slash by the way when you double click and type in slash slash it automatically creates a panel and it's waiting for us to give it some sort of a string some sort of a you know name a text so i'll just call this uh box uh box version one box v1 and just connect it the name input here like so there we go then for geometry it's pretty straightforward we just connect our geometry to the geometry input that's nothing you know nothing crazy then for boundary it asks us for what kind of boundary uh does this geometry describe right so if i go in the top here if i go to the boundary menu i can see that it can be an inlet it can be an outlet it can be a wall and in this case of course it's a wall you know these are series of walls so that's my wall boundary i'll just connect it like so i wanted christmas music this is not christmas music happy euphoric no we we changed this we change this okay so we have our geometry that's a wall and that has a name um yeah refinement levels is basically so all of this is going to be [Music] voxelized so it's like meshed only in three dimensions um yeah it's going to be voxelized so this is how small the voxels are going to be uh so in terms of refinement levels i need to um yeah i can't see here let me just enable this part oh okay so it asks for two numbers uh and that's three okay sure so refinement levels basically asks us for when it's going to subdivide the voxels to fit better with the form here what's the minimum amount of subdivisions that it should use and what's the maximum um so in this case we want it to be fast and kind of good enough like precise enough so we will we will create a panel and we'll say the minimum is one comma and maximum is two right so basically wherever it doesn't have any and let me just connect it to refinement levels wherever it doesn't have any um geometry wherever the voxels are not intersecting with any geometry it's not going to subdivide them right that's where uh level one of refinement lies level two of refinement is basically going to subdivide it once i believe i don't know how it works actually it might be that one already subdivides every um voxel and 2 subdivides it even further but either way we are using low numbers which means we are trading off [Music] accuracy to more to store speed and we do need to have a lot of speed here because unless you have an insane computer it's going to run for quite a while a number of layers for snappy hex mesh it's basically there's going to be another voxelization step involved layer down the line and here we will specify how many layers surrounding the shell here are going to have super dense um voxels so in this case i will say three layers because i saw the default values uh were said to be three um so i'm going to kind of stick to three layers and mesh set i'm just going to say uh okay what kind of mesh setting should should we use for this one i'll just say jacket you know setting speed there we go and that's it that's it for for uh this geometry so it's basically what what it did it created this kind of a beefed up version of our box with a bunch of additional information right and it even has a report which probably will say nothing yeah there's there's nothing of course there's there's no errors so then let me actually just turn this off and enable this so that i can i can see what's going on okay so then once we have this geometry here uh setup we want to put it in the wind tunnel right so the wind tunnel oh i believe it's uh as well yes it's under crate battle butterfly crate case from tunnel right here i believe yeah it should be so battle butterfly create case from tunnel we add that which will ask for a name again so i'll do a slash slash again and i'll call this um wind tunnel i don't know oops slash wind tunnel [Music] like that [Music] it's going to ask for bf geometry and we have created it so butterfly geometry goes in here right that's easy and it's going to ask for refer reference regions so reference region is basically a reference refinement refinement region it's basically a region in which [Music] in which the the levels the refinement levels are going to be amped up so basically a volume in which the voxels are going to be smaller thus having more resolution so for ref regions i believe we need to create it [Music] butterfly refinement region there we go this guy right here i'm just going to double check yes it is it is that and this one is going to be oh yeah inside outside okay so it's it's refinement region and it's going to ask for a name so again i'm going to slash slash and call it [Music] space around the box so that it's more clear to you what what what this is right and i'll just connect refinement region into into here and it's basically asking us for geometry um and we don't want to just give it geometry like so that that wouldn't work because we want the surrounding area right off of this box not the box itself necessarily so what we can do well this is a little bit shitty [Music] what we can do is we can create a bounding box around this geometry like that it would make sense make more sense to rotate the bounding box but i don't don't really care that that much so let's keep it as it is like that and we will scale scale this bounding box but not uniformly but rather as with non-uniform factors and the reason why we're using this instead of or wait maybe we can just use scale [Music] yeah let's just use scale instead sorry let's use scale so we're going to scale the box and we're going to scale it not around its center point or rather not around the zero zero zero point but rather around the bottom center point not the center center point but bottom center point of the box the reason behind that is we don't care what's happening underground so we don't need a lot of resolution there so we're going to be scaling from the floor from the center of the floor if that makes sense right um so to get the center point that is at the bottom of the box we will use evaluate box evaluate box component oops like that and we will just say u and v stays the states the default values 0.5 and w is zero zero this is zero or maybe i should just make a slider yeah like that w is zero so then the point is right here in the bottom and we're we're gucci so we can use that now and for scaling factor uh you can use whatever number you want as long as it's higher than one i will say 1.2 so slightly larger box surrounding our shape and this is a region in which a higher refinement is going to take place cool cool okay let me make this a little bit more tidy real fast this is not tidy at all but it will do okay so refinement mode and actually let me hide everything except the scaled version so this is again the box in which more voxels are going to be created refinement mode [Music] i don't even know i believe it's here no it's not here is it in boundary no it's not that's it just give me a second that's not here [Music] no um refinement region is this one meshing parameters mc2d location okay i need to check my notes what are you where are you oh it's a script [Music] do i need to use the script here because i borrowed the script from the example file let's see if if if we need it [Music] okay let's try uh let's try working without the refinement mode it should be fine or we can do distance can we do distance refinement mode uh let's try [Music] will i get the demonetized for this music [Music] no no no no no no we're not risking that okay back to here uh so let's try distance refinement mode okay let's use location refinement mode right there yeah so uh there are there there are a few bugs here and there um apparently it is a part of uh of the plugin is just when i try to check where it comes from it will show me python script which uh doesn't make a lot of sense i guess but it is what it is either way [Music] or rather it makes perfect sense it's just uh unfortunate that it does that okay so location refinement mode let's add it here and level um i believe we use two right [Music] at least we use two here so i'll use the same number um and then for mesh set uh mesh settings grasshopper mesh settings um should we use jagged again uh yeah let's use jagged there we go so that is done so this is part two let me group this this is part one [Music] this is part three and part three is still in and on its way okay so we we have finished refinement and we basically are just saying um that and again inside of this box have more resolution of a second level so basically if let's say our voxels are one meter by one meter by one meter a second level of refinement would be uh 0.5 and then 0.25 so one quarter of a meter by one quarter of a meter so basically every voxel becomes eight voxels in or no not eight sorry four times four sixteen times four sixty four uh every voxel becomes 64 voxels in that particular region okay wind vector so for wind we i don't remember where it is yeah there we go create butterfly wind vector we just create created here plug it in and for wind speed we just say by the way speed is in meters um so we just say yeah 10 meters per second pretty fast for wind direction let's say well by default it's set to be along the y axis which is right here and i think we will keep it right so the wind is going to be going along the y-axis uh reference to wind height is 10 we don't care landscape um so landscape is basically how much of a wind velocity does the landscape eat up so in this case let's say it doesn't eat up any wind velocity so we will use a number zero actually let me double check if we need to add anything no we don't okay that's good and then we have two more inputs so make 2d params i have no idea what those are so we skip through them and tunnel parameters is basically the parameters for the wind tunnel um we will go to create create wind tunnel parameters there we go plug in tunnel primes to tunnel params that's easy and here we just specify what kind of uh size will our winds tunnel have so this is a multiplication um it's it's it's multiplying the existing bounding box rather than um the size of existing bounding box rather than uh creating a new uh new some sort of a box in which the calculation is going to be made from scratch so these values right here are going to be multiplications of of this surrounding bounding box so let's say why doesn't it show us any points i want to show you oh okay so before we add anything here let's create a button to run this or a toggle to run this script toggle boolean toggle connect it toggle through there we go so these eight points are created and they basically describe uh an area in which [Music] the calculation is going to be made right so you can see it as a bounding box i can even make [Music] i can even make a bounding box and show it to you box uh oops that one and right click on it union box there we go so this is a area in which the calculation is going to be made and i think it's way too big so when the word scaling should be less i will say 1.5 [Music] there we go that's closer to the box then top scaling should be definitely less let's try 1.5 as well well maybe 1.5 is a little bit too little here let's try two like that perfect sides x leeward x so sides are going to be these gaps here and leeward is going to be you know the tail um the rest of the box so sites 1.5 i think we'll do the trick yeah that seems okay leeward uh also let's just do one point let's do two for leeward how much is it by default by default it's 15 okay so let's do like uh five yeah that seems reasonable so that we can see the whole draft going on there okay that is done this is running let me just group this part and give it a color like that perfect uh do we need to see the union box no we don't that's that's good enough so this is uh let me group this whole part this is our wind tunnel created and more importantly a case from our wind tunnel created right so we can continue working on by creating what's called a block mesh block mesh uh which is going to be the voxelization part itself right so up until this point nothing was voxelized nothing was subdivided into these small cubes in which the calculations are going to be made and this guy right here is going to do that so it's going to ask um for a case and i could give it it right now should i [Music] yeah let's try i'll give it a case here and it's going to ask me to give it a grading right so the voxels themselves are not going to be the same size of course they're going to be graded um to for me to give it grading i need to i believe go to mesh which is right here and find butterfly wind tunnel grading this guy right here winter tunnel auto grading that's perfect so it's going to ask us for a bunch of things i will give it a wind tunnel like that perfect then it's going to ask us for cell size um i will say so the cell size is the size of the voxel i believe default is one which is one mirror i don't remember how much i used here yeah i used the default so let's keep it actually i used all of these as defaults sure let's let's keep it like that just know that this is the most important setting to change cell size basically if you want the the the script to be more accurate but run much more slowly then you decrease the cell size so again by default it's set to one which is one meter one by one by one meter either way we get cell count 37 45 21 that's perfect and we get more importantly we get the output grad xyz that's graded x y z [Music] values let's see it like that we connect it it's hard to explain without any visuals here but once we see the visuals it's gonna look nice okay so cell count number of cells in xyz has a point uh default is five this value of these numbers of divisions and block measures uh we don't care or maybe we do let's see if we do care oh we can just connect it like that of course the that's my bad cell count xyz connect to cell count there then overwrite we keep it as true and then it gives us two more inputs write and run so right both of these are toggles so write will write this information into an external file a temporary external file that's important run will take that external file and crunch the numbers with that open source cfd program that we've installed so not with grasshopper itself so we need two toggles like that and we will toggle right to be true and we will then toggle run to be true and you can see that for for a second there command command line was was opened up and it ran the the the the script basically to so it crunched the numbers and now we have a output case right so it it basically created those divisions uh so it voxelized everything well to a certain extent let me group this and give it a color because this is an important these two are important toggles okay and let's group all of this as well this is our step four i guess okay so what's what's what are you tunnel parameters oh yeah we already did that um now we will do something that i'm not necessarily i don't necessarily know everything about it but it's uh it's called snappy hexagon mesh so that's that's a fun name but uh it's basically like a secondary refinement i guess of the voxels uh so it it kind of refines the voxels to to be more precise that's that's my best guess so first of all let's find where it is it's under mesh snappy hex mesh right here and actually you can see from um from the icons here right so these are the voxels and snappy hex mesh basically has more voxels surrounding some object right so it densifies the the voxel grid like that asks us for a case of course we give it asks us for location in mesh and then a bunch of other inputs so for this one i i do need to actually check what the hell is going on so location in mesh we don't need any inputs that's great global refinement level we don't need to add anything because we already gave it a refinement level right here which is level two so we don't need to change anything then we have snappy hex mesh dictionary which yeah sure let's just create a snappy hex mesh dictionary which is under it's not under create is it it's under here yes butterfly snappy hex mesh dictionary like that connect that's perfect um then there's this decompose par uh dictionary uh so do i even even talk about this part really really really quickly quickly so there is this where is it even are you here yes so there is this decomposed part dictionary scotch right which basically asks for how how many cpus do we use and these are i don't even know if these are cpu cores or if these are separate cpus but basically if you're running a render farm uh and you're doing cfd modeling with through a render farm then you do need to use this like that and then connect you know oh i have 180 cpus and then connect that slider right like so but in this case i'll just delete that and won't won't mess with that at all okay so we have this this guy almost ready and it also has the write and run options so let's go for toggle toggle false there we go that's for write and toggle false for run let me as always group them give them a color um orange yeah that's that's good group this and let's run it so first we write we always write first and then we run and now it's going to do the actual leg work uh through this command line here and it basically just explains everything that it's doing and so on if this cmd.exe file doesn't open up for you uh the command prompt uh file doesn't open up for you then you can still no you can't okay never mind i thought that you could just hook up a panel to the report but you can't so you need to wait until it's it's finished it usually takes a few minutes to to do if i were to check my cpu loads and so on it's not necessarily running at full blast right so memory usage not that high cpu usage definitely not that high only 40 doesn't go into turbo mode so it's not perfectly optimized but it is using all of the 12 12 cores that i have which is great and let's give it a second okay so while it's doing that let's see if we can change the music because this is a little bit [Music] or maybe it's it's enough to it's enough of this christmas christmas music let's let's see what what else we can we can listen to [Music] what's this this is good or maybe let's listen to some hip-hop okay so it's doing the thing here okay let me pause the video for for a bit and then we will continue once it's done because it's taking too long there we go so we're back and it took it 4.5 minutes to calculate but it's done now uh so now we have a case that is ready to be solved right so everything is divided up and everything is good to go so it's time to solve it right um let's go to create no it's not under create oh my god now we need to yeah it's under solution of course it is butterfly solution we will be using that it will ask us for a case of we do have a case here it will ask us for a recipe and the recipe we of course expand the tab called recipe and we will find either heat transfer or steady incorporate incompressible recipe so we will be using the let me just say the blue one we will be using the blue one and let's just connect recipe to recipe and that's it uh we will not be messing around with any inputs here that's way too geeky way too much so we will be just using the default values they seem to work so let's not mess around again decompose decompose does exactly the same thing as the decompose here if you have too many cpus you can kind of specify that you have too many cpus um then you have solution parameters so solution parameters are located here under solution butterfly solution parameters you have that input here you connect it to solution parameters like so which asks us for one two three inputs control dictionary probes additional parameters i don't remember what those do let me check control dictionary is just dictionary and probes are of course uh probes for uh actually measuring the the the values that we will get from the solution output so i'll explain more about it once we get there so for control um dictionary let's see where it is it's not here it's probably under solution yeah uh under solution it's butterfly control dictionary we just can't hook it up like so we don't mess we don't change anything start time and time and time step a thousand that's a lot let's do a hundred just because uh this is a tutorial and i don't want to wait that long right interval um it's a hundred so that's fine write compression purge right yeah everything else is whatever so end time 100 to run a decent simulation you need around 500 but again we don't want to wait that long probes for probes we find butterfly probes it's under solution as well we just connect it like so it basically asks for points fields or right and right interval we only care about points um wait i do need to give it uh ah okay yes uh so we do care about points and fields um [Music] so points are going to be points at which we measure the wind direction and the intensity of the not the wind the air right the direction and the intensity or the speed of the air at different points so we will need to create a grid for that and then we have fields which is u p or k if i remember correctly u is if we give it the letter u capital u it is going to give us vectors so basically direction plus strength if we give it the letter p it's only going to give us just the strength value so connect u to fields and for points uh we need the surface and i believe i do have a surface here show selected yes i do i do have a surface here which is right here and i'm not going to mess around with its placement but basically just create a surface like so something like this and reference it in srf as as a surface set one surface bam then we will let me hide it we will divide that surface into u and v values so for u i will use in this case i want it to go fast so i'll use like 50 and for v i will use a hundred something like that so it's uh 5 000 in in total uh let's do 4 000. now let's do 3 thousand yeah something like that 30 by 50 by 100 so we have a bunch of points i will flatten the output of p right so so all of the points are flattened out now and i will get rid of the points that are inside of my shape because i don't care about them so i will ask in mesh or mesh inclusion i will ask whether or not the points are inside or outside of this mesh right here so mesh to test is going to be this guy but oh this is a b rep not a mesh so i need to mesh it first let's just do it the fast way connect it like so mesh when you connect the b b-rep to a mesh component it automatically meshes it the more you know and i'll just drag it all the way to here so this is the mesh in which we're checking these are the points we connect them like so and is it strict or not we don't care uh so now we have a bunch of inside outside statements and if i use those statements to cull uh curl pattern uh to to call the points with those statements i'm left with only the ones that are inside of the box but i don't care only about the ones that are outside of the box so i need to right click on the p input of the call and choose to invert the statements so what was true becomes false what was false becomes true and now i get all of the points that are outside of that box in that particular area okay so we have a bunch of points here let's move them a little bit back and those are the points at which we probe at which we measure right okay so once we've done that this is all good to go then we still have three inputs here interval that's going to be um how often does grasshopper show us the output so i will say every 10 seconds that's our interval right is going to be yeah as as per usual that's going to be a toggle run is also going to be a toggle so for now i'm not going to turn it on because well maybe i'll turn on the right but i will not turn on the run because for for me to run it i want to kind of see something here right so i will i will say give me give me the solution and what kind of output do i want to get from solution load probes value load probes value so solution goes in here field so we are using field u i will be checking for that slash u or capital u like that and it's going to complain but that's uh that's normal because we are not running the jesus christ this is so bad uh we are not running the solution so it's not receiving any uh any values maybe i can do that again ah there we go so now it's now and now it's going to be red not sure why it's red we will see if it's if it's going to make a mistake we will check once once we run it but basically here we will get vectors right and to display those vectors i will be using a vector display x component which basically asks us for a bunch of points and vectors to display so our points are going to be the points from which we probe so these cold points right here are going to be our points and vectors to display are going to be the values from here so i'll just hook up these values to a vector component like that and these vectors are going to be the ones that are going to be displayed and then we have a color i actually want to color those vectors so i'll use a gradient right click on the gradient choose a prettier choose a prettier gradient connect it like so and i will just say okay so let's say there are different lengths of vectors so i need to measure the length length of the vectors like that um and the ones that are short are going to be red the ones that are longer going to be blue or other way around the ones that are long are going to be red the ones that are short are going to be blue so i will say give me a a domain no range no not range uh i keep forgetting the name of it um bounce bounce give me the bounds you know the minimum and maximum values that i get from the lengths so these are the bounds and deconstruct this domain the construct domain you construct this domain to start and end and basically then i'll just hook up the end to l0 and start to l1 meaning that i'm flipping uh the the domain upside down so the long vectors are going to be red and for my parameters i'll use the vector lengths like so oh that's a lot of wires i know let me try to make it as clear as possible there we go like that should be good to go uh we save the definition and we we just run it don't we we just run it double click so now it's going to start calculating and we will see this is going to stay red if it's gonna stay red i will need to pause the video to check why is it red no it's not red but it's the values that we get are empty wire dm team huh it's not empty anymore ea so you can see all of the vectors that are being calculated here and it's basically going to run for for for quite a while right it will um actually for a hundred steps and then it's once it's done it's done cool cool um i don't know why it's not updating that that often maybe it will update every 10 frames or something like that it should be updating every um 10 seconds not sure what's up with that but it is working right and we are seeing some some values going on here let me turn off the the simulation now and this is what we get so far it's nothing too special and actually the vectors are a little bit too intense so let me um create uh let me unitize uh unitize the vector so all of the vectors are have the length of one and show them like like that so that is it's more like a grid and now you can see better what's what's going on right i think that's cool i think that's cool of course it's not uh it's not three-dimensional and in in this sense we need much more um much more planes for for it to be three-dimensional but it's a good start okay um let's do it with the grasshopper sure let's get rid of the box and hook up the grasshopper there so before we do that i will turn off i'll turn off all of the goddammit how are they called all of the toggles just so that it doesn't immediately start calculating everything and actually let's group the last toggles here that's for the solver and now i will set one geometry set my grasshopper in here it's gonna take a little bit of time now it's all set i will run the first toggle or actually let's check let's check this refinement region let's see the box so the box is here this is how um and here i'm using 1.25 that's even larger okay so that's that's fine so we create wind tunnel we toggle true 3.3 seconds that's good let's hide this or rather no show we we we showed this we hide this surface and we hide the shape itself okay so this is true now we write it and we run it done 2.2 seconds then we write the snappy hexagon mesh and we run it and it's gonna take a a while so i will pause the video and then we will continue once it's done okay and we are back so it took 7.1 minutes to complete so that takes a while apparently but we are going through this so now what we need to do is we need to solve for the solution right just like we did with the box previously so the only things there are two things that i need to change here the first one is the end time right i want this to be a little bit more precise in terms of that the computation itself so instead of having end time set to 100 i will give it a little bit more time to converge so i will try 200. i think around 500 would be the ideal end time for something like this but we don't want to wait that long okay so we have that going on and then the other thing is the resolution right so you can see the resolution here in the column and these are all of the points that are going to be measured and also why oh yeah that's that's that's fine so these are going to be all the points that are going to be measured and evaluated and i'm going to increase the resolution i think two-fold so instead of 100 we'll have 200 and instead of 30 we will have 60. um just to save some time because this will take a while to calculate i will disable this [Music] this node here and then i will plug in my new sliders to u and v values delete the old ones and then run the mesh inclusion check the reason i'm doing this is because when i um when i plug in the sliders i plug them in one by one and if you do it um if you do it one by one that that means that mesh inclusion will calculate will solve for the sliders one by one so instead what we want to do is we want to solve for them uh both of them immediately or at the same times to to just save some time either way now we have twice as much resolution it's still not perfect here but that's that's fine that's good enough i think all right let me disable the color so that we don't need to see it we have our values here which are null at the moment because we are not running anything and we have our vector display so let's see if there's anything else i want to change so this will update every 10 seconds [Music] i think we can go for shall we go for something lower let's go for seven seconds or maybe let's go for something larger um let's go for 20 seconds just to give the computer a little bit more time to um to not converge but to calculate and not waste a lot of time trying to show us the output maybe 20 is a bit too much let's go for 15. okay so as per usual we toggle this to true right so it shows something like this which is definitely not you know not good but it hasn't started solving so that's reasonable and we'll toggle this to true as well which is run and now it's going to begin the calculations um this will take quite some time i think it's going to be we are running 200 steps so it's going to be like an hour hour to to calculate so what i'm going to do is i will hide my webcam and i will make this as pretty as possible so that you can see a sped up version of this whole thing being solved so first things first i will minimize the grasshopper window i will look at it in the right hand side view like that should we oh it's it's now calculating just give me a second there we go so i will zoom in to make it as nice as possible i will change the display color the background color of the display to black just something like this and yeah i think that's uh that's good enough let's minimize make this as small as possible larger like that perfect so now i will disable my webcam like that and i will just let this run [Music] do [Music] do okay so there we go so that didn't take too long i think around half an hour maybe 40 minutes so i could have done a like a done it in a higher resolution or made more steps um but just as a proof of concept i think this is good enough um one thing that you will notice is that it's not actually um it's not actually color coding the the vectors that well and the reason behind it is that there are a few vectors that make a let's call it an error right that that are not that accurate so if i were to check the vector length bounds let me just grab a panel just show it to you so the bounds are between something that's quite close to zero and something that is an extremely large number so this isn't like trillions trillions trillions um so that vector is nonsensical right it doesn't make any sense so we need to kind of get rid of them get rid of those vectors here and ignore them and the way we do it is by just measuring so here we have the vector length measurements and we just say is it smaller are these lengths smaller than let's say a hundred right anything that is larger than 100 should be dismissed as nonsense right so then we get the answer true and false like for for every vector it's either true or false is it smaller than a hundred and with those values we just call call pattern we call all of the lengths so that's the list that we call uh with this pattern so basically we get rid of all of the vectors that are way too large and then instead of just the pure vector link we plug in call into the bounds like that and immediately it colors it that's all we needed to do and now just to make it a little bit more nice maybe let's change the the preset here um that's four colors i just need two colors there we go two colors for a preset um so the stronger the [Music] the the vector the brighter it is so we can kind of mess around and see you know we we can see what what kind of drag we get and also of course we can color code it any way we want by just right clicking on the gradient uh circles i don't know how to call them circle things and just changing them up [Music] something like that well maybe that that should be actually bluish let's go for blue and that should be red like that and then somewhere in between i don't remember how to add how do you add [Music] yeah it doesn't matter um i forgot either way this is what what we end up with this vector grid and yeah that's that's about it that's that's how it looks like so there are a few main things to note here first of all it's not a dynamic representation of the wind flow if you want a dynamic representation you would need to run a swarm through this and i can do it quite quickly if i were to just say show show give me that surface right here i will just reference in the surface that is not the surface srf there we go right click set one surface so that's done let me hide it again and then i will say give me the edges of the surface like that so we have four edges and then using list length or rather list item [Music] i'll just get this edge of the surface right here oh that's actually the first one on the list yay okay so we have that going on and then i will divide that edge to get a bunch of points on it let's say 100 100 points like that [Music] and i believe that should be enough for us to check if it's going to work so basically i want to move these points along these vectors [Music] to to simulate the wind flow and these points should draw lines as they move so i will need a loop for that loop start i'm using anemone for this loop end there we go we connected i'm going fast with this because this is not a part of the tutorial it's just something that i want to test out if it's going to work or not so trigger is a button number of iterations let's go for one for now uh loop start so we start with the points you know the starting positions of the points and all of them will move all of them will move [Music] do they move by a fixed amount i don't think they should so we will need to move them along the closest vectors so somehow these points let's say point there we go so somehow these points need to find let's say three or four closest vectors to them and average average out the direction of these vectors how do we do that well first of all we change the music because this is way too there we go so we have our points here and we have our vectors right here so let me just grab a vector component and just bring it here so that it's it's closer so we have our vectors here and we actually need not just the vectors but also we need the the the starting points like the the points in which to which the vectors are anchored and these are the uh probe points that we used here so i'll just grab a point component as well from here drag it here there we go [Music] okay so this is going to be like a group and these are separate points so basically from each of these we will need to pull [Music] each of these points now that won't work let's think let's think let's think there we go so we'll use closest points component cps we will find we will search from each of these 100 points initial 100 points we'll search for let's say three closest points out of this list right here like that and we will end up with indices so these indices right here we will be able to use these indices to extract the vectors that are associated with these points uh so we'll use list item list item for these vectors with these indices and it should be three vectors yes perfect three vectors for for each point and then we need to um get rid of the vectors that are too big again so we will measure the length of these vectors where is it length vector vector length there we go we measure that ask if it's smaller smaller than 100 and we call call pattern so we use the smaller answer of the smaller as a pattern and we call the vectors perfect and now all we need to do is we need just need to get an average an average vector let's just check what kind of output we get perfect okay so we do get that an average vector of all of these all right and all we need to do is just move these points by the average vector like so they seem to be quite quite strong in terms of movement and also that's way too many points that's because this is um a flattened list and this is not so we flatten this one [Applause] and now this seems to be doing the trick it's moving way too fast so i will multiply i will multiply the whole average vector by 0.1 so that it's 10 times weaker than it should be and plug plug it in like so so this should technically work let's see let me hide everything except loop and start okay so that that kind of works but we need more slider 100 okay it's kind of doing it but it's not not that great i wonder if there's any missing points there that got stuck no there's not okay so let's draw a line instead just to see what kind of a curves we will get so this needs to record data the matrix needs to be flipped and we just draw a curve interpolated curve through it insufficient interpolation points for a curve um why is that that is because the recording doesn't work let's try again there we go so it is interpolating let's [Music] see that's kind of doing it but it's way too fast now but it is doing something there okay so we are getting there but the thing is um i don't even know what's what's what that's doing uh we are getting there but the thing is that it's way too fast still [Music] but better than that i think it's great okay so we will be using more neighbors five neighbors we will be using 200 points [Music] instead of 100 we will be not looking at the points themselves only at the curves what else [Music] and we will not be multiplying the the vectors or should we maybe we should but it should be a much smaller value so let's try 0.01 10 times smaller than it was let's just run 100 iterations of it there we go now it's properly lagging so okay so again this is not a part of the tutorial uh we will be uh finishing up just shortly let me just connect it to the panel there we go um this definition for for for those of you who are lazy and don't want to follow along this definition is going to be available for the patreons as per usual we are done with the tutorials um for 2020 thank god we finished with 50 of them and hopefully i'm going to do more much more in 2021 so let me actually let's let grasshopper finish up here let's give it 200 iterations and just see how it how it reacts to the to the grasshopper right here seems to be reacting quite well will you bounce you kind of bounce but it could be better i think we need better resolution but the flow seems to work okay so we are done hope you enjoyed this one and i will see you next year [Music] bye [Music] [Music] so [Music] so [Music] um [Music] you
Info
Channel: Gediminas Kirdeikis
Views: 4,778
Rating: 4.9550562 out of 5
Keywords: blender, tutorial, lesson, grasshopper, solid, solids, physics, chain, grid, antoni gaudi, gaudi, antoni, colission, colision, colisions, hanging chain, free, comparison, simple, fast, real, time, realtime, speed, cnc, wave, sinus, interference, furniture, table, coffee, cfd, fluid dynamics, flow, wind tunnel, wind analysis, analysis, wind, tunnel, fluid, dynamics
Id: pdl0wnX-KQ0
Channel Id: undefined
Length: 81min 40sec (4900 seconds)
Published: Wed Dec 30 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.