Liquid Follows Curve - Blender Mantaflow

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone i'm arya and today we're going to use mansflow to create this fluid simulation we are also going to do a quick setup using the geometry nodes to add some extra particles make sure to like and subscribe and if you want to get a copy of this blend file head over to my patreon page and sign up to become a member you'll also get access to all of the other plan files that you see on my youtube channel and you'll also be helping me to grow this channel okay here we go alright so let's grab a new scene in blender and i just want to show you that i am using blender 2.92 and you can see that this is one of the release candidates so it is almost complete and by using this we are able to access the new geometry nodes section of blender and as well we're able to use the new apic method in manzaflo so make sure to download the latest release by heading to blender.org or you can just follow the link directly in the description to download this here and if you are using a different version of blender it's no big deal you can follow along you just have to skip the geometry notes part and as well instead of using the apic method you'll just use flip hit a to select everything and hit delete the first thing we want to do is add our bottle just because that's going to be the basis for our entire scene so shift a mesh and click cylinder next let's scale this on the z axis so s to scale z and type in 2.1 then we just want to bring it up by the same amount so g zed and type in 2.1 next we just want to scale this on the x and y axis so we're going to hit s to scale hold shift and hit set to lock to the x and y and then we're going to type in 0.5 and now let's just shape our cylinder so tab to go into edit mode the first thing you want to do is just start with our top set of vertices here so let's just click away make sure you're in vertex or edge select mode either one and then you can hold alt and just click to select this top row of vertices hit s to scale and type in 0.5 next we'll hold ctrl and r again click then hit escape to add in a new set of vertices and then we can scale this as well so s to scale shift z and type in 1.2 control r again to add a loop cut in between these here escape and then we're going to scale so s and type in point a then that should give us the basic shape so now we just want to add some supporting geometries so i'm going to hit ctrl r and just drag this up to the top and do that for each of these so bring these down here which will just give you a nicer curve let's add one to the bottom as well so ctrl r and we'll just bring this all the way down we also want to add some geometry to our bottom face here so again we're going to hold alt and click this edge loop then hit i on the keyboard and just drag into the center to add some geometry we'll just do that two or three more times for the top what we can do is just go up here hit three to go into face select mode or you can just select here on the top left click to select this top face delete and select faces now we can hit tab to go back into object mode right click and shade smooth now that we've got our basic shape let's head over to the modifiers tab on the right click here then we're going to select this is select solidify set the thickness to 0.1 then we're going to add one more modifier so click here and click subdivision surface and then set this to two and i know this is super basic you could probably make something a lot nicer but this is gonna work for now just before we move on let's head over to the physics properties and click here click fluid and we want to turn this into an effector just because we may have some interaction with our fluid so let's select this here and click effector just to be sure that we don't have any liquid crashing through our geometry let's set the thickness to 0.2 and mostly this is just going to affect this top area here as the liquid comes out next we can add our emitter so shift a mesh and let's click icosphere then we want to scale this so hit s to scale and type in 0.15 g instead and we can just bring this all the way up just until it's just at the top of our bottle by the way let's start naming stuff just so that we don't get confused so bottle for our cylinder and we can name our ico sphere emitter now that we've got our emitter we don't need to make any other changes let's just head over to the physics click fluid then set the type to flow change smoke to liquid and since we want a constant inflow let's change this from geometry to inflow if you keep it on geometry you basically just get one burst of liquid finally let's add some velocity so let's turn on initial velocity head to the set and type in five then finally to make our fluid simulation complete we're going to add a domain so shift a mesh and let's select cube then let's just bring this up so g said and type in three and then let's scale this so s to scale and type in 3.5 if you just come up to the right here you can turn on the x-ray toggle just so that we can see through then we can head over to the physics properties click fluid and set the type to domain we want to set that type to liquid to match our emitter then for this tutorial we're going to set our resolutions to 64 to start let's set this time scale to 0.5 which will just cause our liquid to move at half the regular speed then again depending on what you're using i'm just going to change mine to apic but if you're not using blender 2.92 you can just leave this to flip keep on scrolling down and we're just going to add some diffusion and we can just leave that to default next we want to add a mesh basically this will be the thing that covers our liquid so activate that and then you want to set this to two or three one thing that i like to do since we are going to be making some changes with this is just add a second window so head down to the bottom here just until you see this plus symbol then you want to click and drag to open up a new window scroll all the way to the top and you can click this little pin icon and what that will do is sort of set it in place to wherever you put it so i'm going to scroll all the way back down until i've got our cache settings here now once we go make some changes to our other things we don't always have to come back and scroll down we can just have the settings that we need right here all right so if we were to play our simulation now you don't have to do this i'm just going to show you quickly it's just going to basically shooting straight up so now what we want to do is add in the guide for our liquid so the way i did this was going to the curve so shift a and curve and if yours doesn't look like this with all of these extra curves there's a quick way to do that so just head up to the top left click edit preferences add-ons and then you want to search for the word extra and you just want to make sure that the ad curve extra objects is turned on then again shift a and go to curve all the way down to the bottom you can see curved spirals and we want to click this first one here our communion when you click that you should see a menu pop up on the left if not just make sure to click this little arrow here to open that up first let's just set our height just so that you can see what's going on here so i'm going to set that to 2.1 and then if i set my turns to do you can see that it adds an extra level on top of that let's give our radius a value of 0.75 just to tighten up our spiral and then if you want the spiral to sort of shrink over time what we can do is use the radius growth and type in 0.5 then the final thing we want to do is just invert this so let's head over to the rotation and you can either use the x or the y and type in 180 and that's it so now we can hit g instead just to bring this up and then you want to have the top vertices just above the bottle here then i just modified this a little bit just to grab our fluid a little bit earlier so if you hit 7 on the numpad you can go into top orthographic view and then you just want to grab this last vertice hit e and we can just drag this over until it's right above our emitter if you want you can just bring it up a little bit too so g said and just bring this up that way as soon as our fluid gets to here it'll start interacting now we can hit tab to go back into edit mode and then i'm just going to rotate mine a little bit just so that it's facing a different way so r to rotate zed and type in 90. now if we were to just leave our curve this way our fluid would sort of be more cylindrical and in our case we want it to be a little bit more flat so let's add some extra geometry to this curve and the way we do that is just heading over here to the curve properties on the right select this little curve icon and then if we just scroll into here we can open up the geometry tab then for our extrusion we want to type in point 0.2 and as well we want to set our bevel depth to 0.025 now that we've got our base curve we can use this to add all of our forces then we want to head over to the right to the physics properties and add our first force field so let's click here then our first force is going to just be called force so we're just going to leave it as the default if we were to just leave this as default basically what you have is a force here with a center and everything would be pushed out from the center in 360 degrees so to utilize this curve what we need to do is change this shape to curve and what this will do is turn our entire curve into a force so that each part of this will be acting as our force instead of just this little area here then the only other thing we need to do is change the strength to minus 20. save and if i was to hit play you'll see that our liquid just sort of still goes straight up so this is where this comes into play every time you add something uh for some reason blender needs to recalculate so the way i do that is i just reselect replay and of course make sure that you're on frame one as well now if i hit play you can see that our force will start to take effect awesome so that's looking great while we're seeing that let's just make sure to select it right click and shade smooth now we need to add in our new force so let's just select our spiral then let's name this force just because we're gonna have a few of these so just make sure you have it selected hold shift and hit d then escape and just head back to frame one let's rename this into vortex we don't need to see our force objects anymore so i'm just going to head up to the top here and turn on some render toggles then i'm going to just turn off the visibility for the viewport for our first force and as well for the render then the center one we want to leave on so that it's still active as part of our simulation down into the physics properties let's change the type from force to vortex let's leave this at curve and set the string to one i'm just gonna quickly show you so replay and hit play great so now our liquid is starting to take the shape that we want but let's hone this in a little bit more by selecting our vortex back to frame one then shift d to copy and escape let's turn off our vortex force and rename our new force to harmonic add down and change the type from vortex to harmonic let's leave the strength at one set the damping to zero and the rest length to two then you'll notice what this is doing is just bringing our fluid together a bit more and now you see that that's looking a lot better so our liquid is sort of sticking together better now but we want to take this one step further so again back to frame one shift d and escape to add a new curve let's hide our harmonic and name our final force to turbulence head down again then let's change the type from harmonic to turbulence set the strength to 25 let's make the size quite large to 10 and set the flow to two and of course this is pretty straightforward this is just gonna give our liquid some noise then one more time we'll just hit replay and i'm just going to show you how that's looking our liquid is looking really good and it's a lot more flat in my animation i had my liquid disappear so i'm just going to show you how to do that and this is just optional if you want to have that effect as well so we'll just hide our turbulence and then we're going to add in a new curve so shift a curve and we're going to do the same thing so curve spirals and our communion let's do the same setting so 2.5 0.75 and we'll do 2.1 for the height let's rotate this on the y-axis by 180 then we just want to line it up so let's turn our turbulence back on for a sec then tab to go back into object mode g instead and we'll just bring this up make sure to rotate it as well so our zed and type in 90. then again just g said and we'll just bring this up right until it's matching our other curve and that should be good so now we can just again hide our turbulence then while we've got our spiral selected we'll head into the object data properties again we're going to set our extrude to 0.2 but we're also going to set our depth to 0.2 as well now if we head into the physics properties you can see that we can't add this to manta flow so what we need to do is just turn this into a mesh so let's right click and convert to mesh now you'll see that we've got our fluid option available so let's select fluid and then we're going to select flow as the type and set this to liquid and outflow i'm just going to add a little bit more geometry to here just in case our liquid goes a little bit farther so make sure to select all of these vertices right at the end to select all those and then you just want to hit e and we can just bring this out just a little bit along the x-axis and now you can hit tab to go back into object mode now that we've got that complete let's name this outflow and just before we head back i want to select this emitter and instead of emitting all the way till frame 180 let's bring this all the way back to 100 just to make our emission a little shorter i did a bit of a test and it was just too much so now when we go to frame 100 you can see that we're using our inflow but by the next frame we're going to shut that down and now finally we can select our domain and if you do have a slower computer just leave this to 64. i'm going to set mine a little bit higher to 80. and i know this doesn't seem like a lot but my computer will bake this at 64 resolutions in four minutes whereas if i set it to 80 it takes about 11. so just keep that in mind and then we'll head all the way down to the bottom make sure again that you've got your emitter set to turn off at frame 100 and your outflow to start at frame 190 then we'll go all the way down to the cache and we'll select this and switch from replay to all then make sure to save and hit bake now that that's complete make sure to hit save and let's just turn off our outflow object and we can also turn off our emitter then hit play and we can watch our simulation awesome so that's looking pretty good you may want to run your simulation a little bit longer and just tweak your outflow object a little bit then now that we've got our simulation complete we can start putting together the rest of our scene so let's add our ground plane shift a mesh and click cube then let's scale this so s said and type in point one we also want to scale this on the x and y so let's hit s to scale shift z and type in three let's just quickly add a bevel hold ctrl hit b and then we'll just drag this out a little bit you can also scroll up and down on your mouse field to add more or less cuts i'm just going to do that one time tab to go back into object mode right click and shade smooth then we can head into the modifiers click here and we're going to add a subdivision surface and set these to two great now we can just move this down so cheese add in we'll just bring this down just underneath our bottle next let's add our background cylinder so shift a cylinder and then we want to scale this up so then hit s to scale and type in 25 let's just zoom out and we're going to scale this on the side as well so s z and type in point five let's just line this up so hit three to go into right or the graphic click here to turn on the x-ray and then we'll just bring this up so g said and then just drag this up until that's lined up then we can turn off our x-ray toggle and now we just want to add a little bit more geometry so let's hit tab to go into edit mode hit three on your keyboard or click here to go into face select mode select this top face delete and select faces then we just want to add some loop cuts so hold ctrl r and click then hit escape and then we can set this to six we also want to add geometry to our bottom face so hold alt and select this loop then you just want to hit i and drag your mouse in and do this a few times then we can hit a to select everything right click subdivide one more time and set this to two and that's it so now we can tab to go back into object mode we'll just zoom in and shade smooth let's head over to the modifiers tab click here and we're going to add a wireframe uncheck replace original and then we just want to apply our scale so ctrl a and just select all transforms just to finalize our scene we just need to add some materials and lighting and then to finalize we're just going to use the geometry node just quickly so for our lighting today we're just going to use a single light but first we want to head over to the world properties then just select this color here and bring it all the way down next we can add a light so let's hit shift a head down and select light in point g said and type in 15 to bring this up and you can see now it's way up here so let's head over to the light properties change the power to 20 000 and set the radius to 8. now we can just zoom back in beat this for now and head up to the top let's click the shading tab then we'll just center our objects here and we can start adding our materials so let's head up to the right turn on the render preview and most of these materials are just going to be super basic so let's click our ground plane and select new let's bring the color all the way down and if you're going to stick with ev you want to go somewhere around 25 but since i'm going to be switching over to cycles i'm going to bring this all the way down next i'm going to bring the metallic all the way up to one and then the clear coat to one as well next we can select our cylinder which is just our background cylinder then we want to add the same material so select here and click material next let's select our bottle and click new let's click on the base color here and just give it a slightly blue tinge and then let's just bring this all the way down to about 25 metallic up to one roughness to 0.2 and clear coat to one as well then for our final material we can just click on our domain click new then we'll just again bring our base color down to about 25 value set the roughness all the way to zero and let's bring the transmission up to one and now things are starting to look really good so at this point i'm going to switch over to cycles but if you are sticking with evie like i said just add some value to these objects just so that you can see them a little bit better so into the render properties and i'm going to turn on cycles and set it to the gpu now that we've got this all complete what we can do is add our extra particles so let's just turn the shading off and turn overlays back on i'm going to just select the bottle and if you're using blender 2.92 you can follow along if you're just using an older version of blender feel free to just add some hair particles for those of you using 2.92 let's select here and we can go into the geometry node editor you can see there's nothing here so let's click new then i'm not going to give a full tutorial on this just because there's a lot of great tutorials out there but i'm just going to show you a few basic things on how i got my look so just quickly this is our input geometry which is our bottle and then this is our output so right now there's nothing in between so it's just going to take everything that we've made from our input and set it directly out so anything we want to do has to go in between so we're just going to do a basic little particle setting here so shift a and search for point then you want to select point distribute hover over this and click it in you'll see right away that basically what we have is our geometry and it's going into our point distribute which is turning it into small little points and then outputting it because we want to have our bottle there let's bring that back the way we do that is use a different node called join so let's just shift a and search for join if we just click this here you can see that we've got two inputs so we're gonna bring our points in and we're gonna take our original geometry and bring it back in as well and now you'll see that we've got both there next we want to change which type of object we're going to use for our points so search for point instance and again we just want to click that in our top line here then you'll see that everything disappears because we don't have any input here so let's just quickly add a particle shift a mesh hyposphere head over to the modifiers and add a subdivision surface of two shade smooth then let's just bring this out of the way by hitting gsat and dragging downward select back on the bottle and to get our object here we can just click and head all the way down to icosphere our particles are a little skewed and the reason why this is happening is because if i hit n on the keyboard and select our bottle you'll see that we haven't applied our scale values so again just make sure that you've got the bottle selected then hold ctrl a and select scale then you'll see that our particles are back in two spheres and we've applied our scale so now we need to resize them so shift a and let's search for attribute find attribute randomize then you want to put it in line right here so if i was to change the maximum to 0.04 you can see that nothing really happens at all and nothing is happening here so what we need to do is we actually need to tell this node what to do so in this case what we want to do is just type in the word scale just like you see it then automatically you'll see that now our size takes effect change that back to 0.04 and we could just come over here and up the density but you'll see that if we zoom in things are crashing into each other so to fix that what we want to do is in this point distribute select this and we're going to select this other option here and we can add a minimum distance so let's type in .075 and now you'll see that there's a minimum distance between our particles which is super helpful and not something that you can really do with the particle system and that's pretty much it the other thing that i did is you can see that our particles are going to go underneath as well so you could also add a boolean by simply adding in some sort of geometry so let's just add in a cube then let's just bring this up and we can scale this so it's just near the bottom of our bottle click back on the bottle and the best way to bring this into our geometry is shift a and search for object info click here and we're going to select cube01 then we need to hook the geometry into something so our final note that we're going to add is the boolean so search for boolean click it here and then we can just hook our geometry into our geometry you'll see that it's doing something a little funny so again we just want to apply our scale so let's select cube1 control a and select scale and now you'll see that our particles are restricted to just within this boolean and that's it so that's pretty much our basic setup then if you want you can also add it to the liquid and the best way i found to do this is to just simply replicate it this way if i just quickly turn on the shading you see that the last thing we need to do is just add a material to our particles so let's head back to the layer tab we can select our particle which is our ico sphere head into the materials click new then again let's bring the value down into a deep gray roughness all the way down and let's bring the transmission all the way up the final thing we can do is add our camera so shift a click camera then you just want to pick a frame and set up your view control alt and hit zero i like to hit f3 and search for walk navigation just so i can set up my viewport using the arrow keys and the mouse head over into the camera properties and let's add some depth of field you could use the bottle as a focus object but i find it better to add an empty so shift a plain axis empty then let's just bring this to about the front of the liquid now again back into the camera and we're going to select our empty as our focus object then set the f-stop to 0.2 and then i also added some cubes to the background just to fill up some of this open space if you want to animate the camera head back to frame one select the camera hit f3 and we'll just drag this back then hit i and set a keyframe for the location go to the final frame walk navigation again and we're just going to zoom in i can set a new keyframe then you can just hover over the timeline hit t and set to linear before you head into the render just make sure that you also turn off anything in the render that's not supposed to be there and now you can just pick any frame that you like and let's head into the rendering render and render image and there's our final image so i hope you all enjoyed this tutorial make sure to like and subscribe and as well if you're able to support me with a donation head over to my patreon page and sign up to become a member i'll see you soon bye you
Info
Channel: Aria Faith Jones
Views: 27,049
Rating: undefined out of 5
Keywords: simulation, animation, tutorial, particles, cgartist, vfx, vfxartist, cycles, lighting, eevee, blender, blender3d, how to make, blender tutorial, blender 2.8, blender 2.9, hdri, easy, beginner, stylized, blender 2.83 tutorial, blender 2.9 tutorial, physics, color, movement, simulate, art, lights, fluid simulation, fluid simulation blender, fluid simulation blender 2.9, apic fluid simulation, depth of field, liquid simulation, apic liquid simulation, geometry nodes blender, mantaflow, mantaflow blender
Id: hFr3y2S8nTw
Channel Id: undefined
Length: 28min 56sec (1736 seconds)
Published: Sat Feb 20 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.