Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
225 views157 pages

Openfoam Tutorials

.

Uploaded by

shailja upadhyay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
225 views157 pages

Openfoam Tutorials

.

Uploaded by

shailja upadhyay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 157

OPENFOAM TUTORIALS:

In this you have a propeller stl file. The project is you have to setup a dynamic
meshing case where the propeller will rotate at 5700 RPM. All we need is animation
of streamlines for 10s of flowtime of the simulation.

Dynamic Mesh OpenFOAM


Tutorial 4 - SolidBody and AMI
(0:00) Hello everyone, it's Sebastiano Stipa, welcome to the
fourth tutorial of the Dynamic Mesh series. (0:08) Today we are
going to see how to use the (0:14) Solid Body Motion Solver
together with the Arbitrary Mesh Interface, the AMI, (0:24) in open
form, in order to rotate the same airfoil of the previous
cases. (0:30) First, let's talk about the method a little bit.
(0:36) Here we will basically split the mesh of the airfoil in two
regions (0:44) with an asymmetric geometry, which is a sphere or
a cylinder. (0:50) In our case we'll use a cylinder because the
case is 2D. (0:55) So we will define two regions in the mesh,
which are region 0, which is (1:04) this circular region where the
airfoil is enclosed, and the external region, (1:13) which is the
base mesh that we used in the previous cases, minus this region
1, let's say.
(1:22) So, why we will define these two regions? Because
basically we will apply the Solid Body Motion (1:34) to this portion
of the mesh, the inner circle, so that it will rotate rigidly around
the point, (1:43) which will be defined by ourselves, and simulate
the pitching of the airfoil. (1:51) Just like this. So this approach is
very useful, in this case we use the same mesh (2:00) as the
previous cases, but it's not very, let's say, indicated for this
application because (2:08) you see that the wake zone of the
mesh is rotating with the cell zone.
(2:15) So in order to use this approach we would have to change
the mesh a little bit in order to (2:21) ensure accuracy in the inner
portion of the mesh. (2:28) So let's have a look at the case. This is
not a difficult application, a difficult problem, (2:36) using the AMI
and the Solid Body Motion solver, but we have to work a little bit
with the mesh, (2:46) because the meshing process is the most
difficult part for this tutorial.
(2:53) So, we have the 0.orig folder, which is the same as the
previous cases, (3:01) where the initial condition and boundary
condition are set. Then we have, I created (3:08) a logs folder,
where all the logs will be put. Now it's empty because we didn't
run anything.
(3:19) Then we have a master and a slave case, so I will explain
them in a moment. (3:26) And then we have the solution folder,
where the solution, let's say the case containing
the (3:33) solution, will be put. These are automatic scripts in
order to, let's say, have an automatized (3:47) procedure.
Here in this tutorial we will go step by step, but just by running all
run, (3:55) all the case will run and then all clean will clean up the
case. And then we have the usual (4:00) initial condition that I
like, in order to parameterize some input data, (4:08) which are
the same as the last tutorials. So, the idea is to create two
different meshes, (4:18) as we would run two different cases, and
then merge the mesh together and put the resulting (4:27) mesh
into the solution folder, defining a case which will be run with the
input form.
(4:39) So, in these two folders then there is, let's say, a case,
properly, without the zero boundary (4:49) condition, the zero
folder, because we will not solve anything inside these two
folders. (4:56) So, let's have a look inside the master folder, we
have the constant and system directory, (5:02) and in the slave
folder as well we have the constant and system
directory. (5:09) These two folders are really the same except
from one parameter, for some parameter, (5:19) which I will
explain in a second.
Let's now have a look at the process in order to (5:29) start
dealing with this case. So, we'll enter the master case (5:39) and
then we will copy first the initial condition. (5:53) Okay, so, now
let's run BlockMesh and let's see what happens.
I will anticipate this is (6:04) the same mesh, the same
BlockMesh, with respect to the previous tutorials. So, it'll run
fine. (6:18) Just to show you, this is really the same mesh with
respect to the other cases, defined exactly (6:36) like the other
cases.
So, now what we're going to do is to use the
SnappyXMesh, (6:43) the open form automatic mesher, in order
to extract a sub-region of this mesh. (6:52) So, we're going to
define a cylinder inside the SnappyXMesh and then tell
SnappyXMesh to extract (7:02) the inner part of the mesh, the
inner part of the mesh with respect to the cylinder. (7:12) So, we
are going to use SnappyXMesh, which is located in the system
directory, (7:21) the SnappyXMesh dictionary.
So, let's have a look. SnappyXMesh goes through three main
processes, (7:31) which are the CastellatedMesh, which is
something like a Lego building, (7:37) like the mesh is splitted,
the cells are divided in cells which are inside (7:49) the geometry
and cells which are outside the geometry, because in
SnappyXMesh we have (7:57) basically almost always to define a
geometry. And then SnappyXMesh will remove the
cells, (8:08) which are not, let's say, trespassed by the fluid.
So, where there is fluid, SnappyXMesh (8:19) will keep the cells
and where there's not fluid, SnappyXMesh will remove the
cells. (8:24) So, how do we tell SnappyXMesh where the fluid is?
There is one parameter, which is the thing (8:34) that changes
between the master and the slave case, which is the location in
mesh. (8:41) So, given this point, which is a point, every cell,
which is (8:54) connected to this point, without crossing, let's say,
a surface, (9:05) a watertight surface, will be kept, while the other
cell will be removed from the mesh.
(9:16) Then there is the AddLayers procedure, which is false in
this case, because we are not (9:23) using AddLayers. So, in this
case, we are not exploiting the full potential of
SnappyXMesh, (9:29) we are just using it to extract a portion of
the mesh. So, we define, in the geometry (9:40) section, we
define a cylinder, which is a type searchable
cylinder, (9:48) pretty like the way we define the cylinder in the
block mesh.
(9:58) This cylinder has its axis in the middle of the airfoil and a
radius of 2. (10:09) And it's the cylinder which will delimitate the
inner portion of the mesh with respect to the (10:15) outer
portion of the mesh. And it's crossing the mesh entirely, you see
that the Y is (10:24) minus 1000 and plus 1000. So, we can call it
watertight, which means that it splits the mesh (10:33) in two
regions, which are not connected.
If you put fluid in one region, (10:39) the fluid will stay there and
will not go into the other region. So, (10:44) this will be useful in
order to tell SnappyXMesh which region to remove or
keep (10:53) with the LocationInMesh parameter. So, having
defined this cylinder, we have also to, (11:06) in order to let this
cylinder be created as a patch, specified it in the refinement
surfaces.
(11:16) We specify the name of the patch which will be created
from this cylinder (11:23) with a zero refinement level, in order to
just extract this patch without any refinement. (11:32) And we
say that this patch is of type patch, which is a general type for
patches in OpenFoam. (11:42) So, we now, yeah, the snap control
are the same as any tutorial, you can have a look at (11:54) the
Motorbike tutorial, and the AddLayerControl is really ignored by
SnappyXMesh, by OpenFoam in (12:03) this application.
Then, you see that there is an IncludeMeshQualityDict, which is a
file located in (12:12) etc in the OpenFoam directory, and I copied
this file inside the system directory. (12:20) So, let's see what
happens if we run SnappyXMesh, we add the overwrite option in
order to (12:39) let OpenFoam write the mesh without increasing
the time step. So, it's very quickly, as you see, (12:50) because it
only has to remove a portion of the mesh and without doing any
refinement, (12:58) any layer addition, any more complex
operation.
So, what we got here is that we extracted (13:15) the portion of
the mesh, the inner portion of the mesh. (13:22) So, now we'll
have this patch, which is called Master, as we can see from this
menu, (13:35) if we highlight only the Master patch and the
AirFoil, we see that this is the Master patch, (13:42) then we have
the AirFoil, and then we have the back and front, and
then (13:54) we have the whole group, which is the AirFoil, I
guess. (14:01) Yes.
So, you'll see that by doing this manipulation to the mesh,
OpenFoam deleted all the (14:14) let's say all the patches, all the
boundaries that we defined within the BlockMeshDict, (14:20) and
also you'll see that SnappyXMesh did some modification to the
mesh, (14:27) deforming it and adapting the cells to the
cylindrical geometry. This is no more, (14:39) let's say, this is no
more the mesh that we had after the BlockMesh, but (14:47) it is
a little bit deformed, as you see. (14:52) Then we do the
ExtrudeMesh, in order to be sure to have (15:02) a single cell in
the infinite direction.
Let me first load the OFS8, oh yeah, it's (15:29) it has not the
option overwrite, okay. (15:35) What is this? Okay, and then we
will have a CheckMesh. (15:43) Okay, so you'll see that we have,
in this case, number of regions 1. (15:52) After the merging
process of the two different meshes from the master and the
slate case, (15:58) we'll have number of region 2. I will say that
this is fundamental in order to use the (16:09) the AMI approach.
So, now let's go to the to the slave case (16:19) and let's copy the
initial conditions. (16:25) Okay, and rerun the
BlockMesh. (16:30) And, as you can see, this is the same with
respect to the (16:36) to the master, let's say, case, to the master
case.
(16:43) It's really the same. And then we will use the
SnappyXMesh in order to extract the (16:55) the other portion of
the mesh. I'll put the two SnappyXMesh files one next to each
other in order to (17:07) let you see the differences between
them.
So, they are the same (17:17) up to here, where in the master the
boundary patch, the circular patch, is named (17:26) master,
whereas in the slave case the circular patch is called slave. But
the cylinder is really (17:33) the same. Then we have the other
difference is here, when we go to define the (17:41) patch and
the type of patch.
And then the third difference is in the location in mesh
point. (17:50) So, we see that here it is located inside the
cylinder, whereas here it is located outside the (17:59) cylinder.
So, OpenFoam will extract all the cells outside of the cylinder.
So, let's run (18:10) in this case the SnappyXMesh override. Okay,
and you'll see that here we extracted the other (18:35) the other
portion of the mesh. So, don't mind about the fact that I used the
same mesh.
This is (18:44) in order to simplify things, but it's really the
process which matters in this case. (18:52) The process which I
am using. So, now note that this patch is called slave.
(19:05) This patch is called slave. So, this is the slave patch,
which is overlapped with respect to the (19:17) master patch.
And, as before, OpenFoam removed those patches which are not
inside the mesh.
(19:28) So, here you see only the back and front, the free string
group, which is inlet plus outlet, (19:37) the slave patch and the
internal mesh, which is the whole mesh. So, now we're going to
merge (19:48) this mesh with the inner mesh and we're going to
use the utility MergeMesh. So, MergeMesh (20:09) comes with
some options, which are this one, and then you have to specify
the master case (20:17) and the add case.
So, in our case, in order to be clear, we're going to
copy (20:28) the content of the master folder inside the solution
folder, which will be the location (20:35) where we are going to
run the simulation. So, we are going to (20:43) the solution, which
is empty, and we are going to copy everything from (20:51) the
master to here. Okay, now we can run the MergeMesh
application.
(21:13) MergeMesh is overwrite and then we'll specify the master
case, which is this one, so we'll put (21:23) a dot and then the
slave case. Okay, so it finished correctly. Now, you'll see that we
have (21:42) seven patches, the airfoil, the back and front, the
master patch, the slave patch (21:51) and the inlet and outlet
patch.
So, in order to use the AMI, now let's have a look at the
mesh (22:05) before doing anything. (22:24) Okay, we missed
something. We missed the ExtrudeMesh into the slave case, so
you see that (22:35) the meshes are not well overlapped,
because MergeMesh is one thing that is really important.
(22:43) It's merging the two meshes, but it's not merging the
regions. In fact, if I go for CheckMesh here, (22:57) you'll see that
we have two regions. Anyway, let's do the
ExtrudeMesh (23:22) and then back to the solution and then we'll
go again for MergeMeshes and now you'll see that (23:47) they'll
be correct.
Yeah, so you'll see that MergeMeshes merged the two
meshes (24:03) but still you can see the interface here and still
are present the slave and master patch, (24:13) which are now
overlapping. So, this one and this one are two distinct regions in
the mesh. (24:23) Now, we are going to create the arbitrary mesh
interface and we're going to use the CreatePatch (24:33) utility,
which has its own dictionary, which is inside the system directory
and basically here I (24:44) specify which are the patches that I
want to create, which type are they and the way I want
to (24:55) create them.
So, here I'm constructing from patches and I choose the master
patch in order to (25:05) create the master AMI, which is a type
cyclic AMI and I have to put these parameters here. (25:16) These
two are not really useful and the transformation is a very
important parameter, (25:25) which can allow for different
treatments of the patch. Here, since we are not (25:33) dealing
with complex cases, let's say that the flow has simply to pass
from one side from the (25:40) other one, we have to put none,
because we don't have a transformation between the (25:50) flow
which enters, let's say, the master patch and exits the slave
patch and then we have to (26:01) specify the neighbor patch,
which is a slave AMI, of course, for the master AMI and which
is (26:08) the master AMI for the slave AMI and then the settings
are pretty the same, except that we (26:15) have to specify the
construct patch and the neighbor patch and the name of the
patch, of course.
(26:22) Sorry, this one. So, this option must be set to false, keep
this in mind. So, now we'll create (26:34) the AMI patches,
perhaps let's have a look at the boundary file inside the
polymesh.
Now, (26:44) the master and slave patch are of type patch, so
this is a generic type, (26:53) which cannot support the cyclic AMI
boundary condition. (27:01) Yeah, now let's run the create patch,
I don't remember if I have to, yeah, (27:22) create patch override,
let's load the OF6, okay. So, adding new patch master
AMI, (27:38) adding new patch slave AMI.
So, now let's go again inside the constant polymesh folder
and (27:47) let's have a look at the boundary file. So, we'll see
that the slave and master patch disappeared (27:56) and instead
master AMI and slave AMI are created. You can create them by
hand as well, (28:06) yeah, it's up to you.
In order to have an automatic application, I prefer using the
create patch, (28:17) but the result is really the same. So, now
that we have those two patches with type cyclic AMI, (28:32) we
can use as a boundary condition for all the variables across these
two patches, for example P, (28:41) the type cyclic AMI boundary
condition and we have to put value internal field and this is the
same (28:50) for all fields because here there is not really a
boundary condition, it's more a way of calculating (29:01) fluxes
across this interface. So, what the, let's say, the arbitrary mesh
interface does is (29:14) non-conformal treatment of the mesh at
the interface.
So, let's try to explain this. (29:24) So, OpenFOAM generally
works with conformal meshes, does not support (29:32) non-
conformal mesh treatment unless you use this boundary
condition. So, you'll see that here (29:39) you have, for example
here, there is not, (29:48) one face is not connected uniquely to
one, one cell is not connected uniquely (29:55) to another cell by
one face, but for example,

Dynamic Mesh OpenFOAM


Tutorial 4 - SolidBody and AMI
(0:00) Hello everyone, it's Sebastiano Stipa, welcome to the
fourth tutorial of the Dynamic Mesh series. (0:08) Today we are
going to see how to use the (0:14) Solid Body Motion Solver
together with the Arbitrary Mesh Interface, the AMI, (0:24) in open
form, in order to rotate the same airfoil of the previous
cases. (0:30) First, let's talk about the method a little bit.
(0:36) Here we will basically split the mesh of the airfoil in two
regions (0:44) with an asymmetric geometry, which is a sphere or
a cylinder. (0:50) In our case we'll use a cylinder because the
case is 2D. (0:55) So we will define two regions in the mesh,
which are region 0, which is (1:04) this circular region where the
airfoil is enclosed, and the external region, (1:13) which is the
base mesh that we used in the previous cases, minus this region
1, let's say.
(1:22) So, why we will define these two regions? Because
basically we will apply the Solid Body Motion (1:34) to this portion
of the mesh, the inner circle, so that it will rotate rigidly around
the point, (1:43) which will be defined by ourselves, and simulate
the pitching of the airfoil. (1:51) Just like this. So this approach is
very useful, in this case we use the same mesh (2:00) as the
previous cases, but it's not very, let's say, indicated for this
application because (2:08) you see that the wake zone of the
mesh is rotating with the cell zone.
(2:15) So in order to use this approach we would have to change
the mesh a little bit in order to (2:21) ensure accuracy in the inner
portion of the mesh. (2:28) So let's have a look at the case. This is
not a difficult application, a difficult problem, (2:36) using the AMI
and the Solid Body Motion solver, but we have to work a little bit
with the mesh, (2:46) because the meshing process is the most
difficult part for this tutorial.
(2:53) So, we have the 0.orig folder, which is the same as the
previous cases, (3:01) where the initial condition and boundary
condition are set. Then we have, I created (3:08) a logs folder,
where all the logs will be put. Now it's empty because we didn't
run anything.
(3:19) Then we have a master and a slave case, so I will explain
them in a moment. (3:26) And then we have the solution folder,
where the solution, let's say the case containing
the (3:33) solution, will be put. These are automatic scripts in
order to, let's say, have an automatized (3:47) procedure.
Here in this tutorial we will go step by step, but just by running all
run, (3:55) all the case will run and then all clean will clean up the
case. And then we have the usual (4:00) initial condition that I
like, in order to parameterize some input data, (4:08) which are
the same as the last tutorials. So, the idea is to create two
different meshes, (4:18) as we would run two different cases, and
then merge the mesh together and put the resulting (4:27) mesh
into the solution folder, defining a case which will be run with the
input form.
(4:39) So, in these two folders then there is, let's say, a case,
properly, without the zero boundary (4:49) condition, the zero
folder, because we will not solve anything inside these two
folders. (4:56) So, let's have a look inside the master folder, we
have the constant and system directory, (5:02) and in the slave
folder as well we have the constant and system
directory. (5:09) These two folders are really the same except
from one parameter, for some parameter, (5:19) which I will
explain in a second.
Let's now have a look at the process in order to (5:29) start
dealing with this case. So, we'll enter the master case (5:39) and
then we will copy first the initial condition. (5:53) Okay, so, now
let's run BlockMesh and let's see what happens.
I will anticipate this is (6:04) the same mesh, the same
BlockMesh, with respect to the previous tutorials. So, it'll run
fine. (6:18) Just to show you, this is really the same mesh with
respect to the other cases, defined exactly (6:36) like the other
cases.
So, now what we're going to do is to use the
SnappyXMesh, (6:43) the open form automatic mesher, in order
to extract a sub-region of this mesh. (6:52) So, we're going to
define a cylinder inside the SnappyXMesh and then tell
SnappyXMesh to extract (7:02) the inner part of the mesh, the
inner part of the mesh with respect to the cylinder. (7:12) So, we
are going to use SnappyXMesh, which is located in the system
directory, (7:21) the SnappyXMesh dictionary.
So, let's have a look. SnappyXMesh goes through three main
processes, (7:31) which are the CastellatedMesh, which is
something like a Lego building, (7:37) like the mesh is splitted,
the cells are divided in cells which are inside (7:49) the geometry
and cells which are outside the geometry, because in
SnappyXMesh we have (7:57) basically almost always to define a
geometry. And then SnappyXMesh will remove the
cells, (8:08) which are not, let's say, trespassed by the fluid.
So, where there is fluid, SnappyXMesh (8:19) will keep the cells
and where there's not fluid, SnappyXMesh will remove the
cells. (8:24) So, how do we tell SnappyXMesh where the fluid is?
There is one parameter, which is the thing (8:34) that changes
between the master and the slave case, which is the location in
mesh. (8:41) So, given this point, which is a point, every cell,
which is (8:54) connected to this point, without crossing, let's say,
a surface, (9:05) a watertight surface, will be kept, while the other
cell will be removed from the mesh.
(9:16) Then there is the AddLayers procedure, which is false in
this case, because we are not (9:23) using AddLayers. So, in this
case, we are not exploiting the full potential of
SnappyXMesh, (9:29) we are just using it to extract a portion of
the mesh. So, we define, in the geometry (9:40) section, we
define a cylinder, which is a type searchable
cylinder, (9:48) pretty like the way we define the cylinder in the
block mesh.
(9:58) This cylinder has its axis in the middle of the airfoil and a
radius of 2. (10:09) And it's the cylinder which will delimitate the
inner portion of the mesh with respect to the (10:15) outer
portion of the mesh. And it's crossing the mesh entirely, you see
that the Y is (10:24) minus 1000 and plus 1000. So, we can call it
watertight, which means that it splits the mesh (10:33) in two
regions, which are not connected.
If you put fluid in one region, (10:39) the fluid will stay there and
will not go into the other region. So, (10:44) this will be useful in
order to tell SnappyXMesh which region to remove or
keep (10:53) with the LocationInMesh parameter. So, having
defined this cylinder, we have also to, (11:06) in order to let this
cylinder be created as a patch, specified it in the refinement
surfaces.
(11:16) We specify the name of the patch which will be created
from this cylinder (11:23) with a zero refinement level, in order to
just extract this patch without any refinement. (11:32) And we
say that this patch is of type patch, which is a general type for
patches in OpenFoam. (11:42) So, we now, yeah, the snap control
are the same as any tutorial, you can have a look at (11:54) the
Motorbike tutorial, and the AddLayerControl is really ignored by
SnappyXMesh, by OpenFoam in (12:03) this application.
Then, you see that there is an IncludeMeshQualityDict, which is a
file located in (12:12) etc in the OpenFoam directory, and I copied
this file inside the system directory. (12:20) So, let's see what
happens if we run SnappyXMesh, we add the overwrite option in
order to (12:39) let OpenFoam write the mesh without increasing
the time step. So, it's very quickly, as you see, (12:50) because it
only has to remove a portion of the mesh and without doing any
refinement, (12:58) any layer addition, any more complex
operation.
So, what we got here is that we extracted (13:15) the portion of
the mesh, the inner portion of the mesh. (13:22) So, now we'll
have this patch, which is called Master, as we can see from this
menu, (13:35) if we highlight only the Master patch and the
AirFoil, we see that this is the Master patch, (13:42) then we have
the AirFoil, and then we have the back and front, and
then (13:54) we have the whole group, which is the AirFoil, I
guess. (14:01) Yes.
So, you'll see that by doing this manipulation to the mesh,
OpenFoam deleted all the (14:14) let's say all the patches, all the
boundaries that we defined within the BlockMeshDict, (14:20) and
also you'll see that SnappyXMesh did some modification to the
mesh, (14:27) deforming it and adapting the cells to the
cylindrical geometry. This is no more, (14:39) let's say, this is no
more the mesh that we had after the BlockMesh, but (14:47) it is
a little bit deformed, as you see. (14:52) Then we do the
ExtrudeMesh, in order to be sure to have (15:02) a single cell in
the infinite direction.
Let me first load the OFS8, oh yeah, it's (15:29) it has not the
option overwrite, okay. (15:35) What is this? Okay, and then we
will have a CheckMesh. (15:43) Okay, so you'll see that we have,
in this case, number of regions 1. (15:52) After the merging
process of the two different meshes from the master and the
slate case, (15:58) we'll have number of region 2. I will say that
this is fundamental in order to use the (16:09) the AMI approach.
So, now let's go to the to the slave case (16:19) and let's copy the
initial conditions. (16:25) Okay, and rerun the
BlockMesh. (16:30) And, as you can see, this is the same with
respect to the (16:36) to the master, let's say, case, to the master
case.
(16:43) It's really the same. And then we will use the
SnappyXMesh in order to extract the (16:55) the other portion of
the mesh. I'll put the two SnappyXMesh files one next to each
other in order to (17:07) let you see the differences between
them.
So, they are the same (17:17) up to here, where in the master the
boundary patch, the circular patch, is named (17:26) master,
whereas in the slave case the circular patch is called slave. But
the cylinder is really (17:33) the same. Then we have the other
difference is here, when we go to define the (17:41) patch and
the type of patch.
And then the third difference is in the location in mesh
point. (17:50) So, we see that here it is located inside the
cylinder, whereas here it is located outside the (17:59) cylinder.
So, OpenFoam will extract all the cells outside of the cylinder.
So, let's run (18:10) in this case the SnappyXMesh override. Okay,
and you'll see that here we extracted the other (18:35) the other
portion of the mesh. So, don't mind about the fact that I used the
same mesh.
This is (18:44) in order to simplify things, but it's really the
process which matters in this case. (18:52) The process which I
am using. So, now note that this patch is called slave.
(19:05) This patch is called slave. So, this is the slave patch,
which is overlapped with respect to the (19:17) master patch.
And, as before, OpenFoam removed those patches which are not
inside the mesh.
(19:28) So, here you see only the back and front, the free string
group, which is inlet plus outlet, (19:37) the slave patch and the
internal mesh, which is the whole mesh. So, now we're going to
merge (19:48) this mesh with the inner mesh and we're going to
use the utility MergeMesh. So, MergeMesh (20:09) comes with
some options, which are this one, and then you have to specify
the master case (20:17) and the add case.
So, in our case, in order to be clear, we're going to
copy (20:28) the content of the master folder inside the solution
folder, which will be the location (20:35) where we are going to
run the simulation. So, we are going to (20:43) the solution, which
is empty, and we are going to copy everything from (20:51) the
master to here. Okay, now we can run the MergeMesh
application.
(21:13) MergeMesh is overwrite and then we'll specify the master
case, which is this one, so we'll put (21:23) a dot and then the
slave case. Okay, so it finished correctly. Now, you'll see that we
have (21:42) seven patches, the airfoil, the back and front, the
master patch, the slave patch (21:51) and the inlet and outlet
patch.
So, in order to use the AMI, now let's have a look at the
mesh (22:05) before doing anything. (22:24) Okay, we missed
something. We missed the ExtrudeMesh into the slave case, so
you see that (22:35) the meshes are not well overlapped,
because MergeMesh is one thing that is really important.
(22:43) It's merging the two meshes, but it's not merging the
regions. In fact, if I go for CheckMesh here, (22:57) you'll see that
we have two regions. Anyway, let's do the
ExtrudeMesh (23:22) and then back to the solution and then we'll
go again for MergeMeshes and now you'll see that (23:47) they'll
be correct.
Yeah, so you'll see that MergeMeshes merged the two
meshes (24:03) but still you can see the interface here and still
are present the slave and master patch, (24:13) which are now
overlapping. So, this one and this one are two distinct regions in
the mesh. (24:23) Now, we are going to create the arbitrary mesh
interface and we're going to use the CreatePatch (24:33) utility,
which has its own dictionary, which is inside the system directory
and basically here I (24:44) specify which are the patches that I
want to create, which type are they and the way I want
to (24:55) create them.
So, here I'm constructing from patches and I choose the master
patch in order to (25:05) create the master AMI, which is a type
cyclic AMI and I have to put these parameters here. (25:16) These
two are not really useful and the transformation is a very
important parameter, (25:25) which can allow for different
treatments of the patch. Here, since we are not (25:33) dealing
with complex cases, let's say that the flow has simply to pass
from one side from the (25:40) other one, we have to put none,
because we don't have a transformation between the (25:50) flow
which enters, let's say, the master patch and exits the slave
patch and then we have to (26:01) specify the neighbor patch,
which is a slave AMI, of course, for the master AMI and which
is (26:08) the master AMI for the slave AMI and then the settings
are pretty the same, except that we (26:15) have to specify the
construct patch and the neighbor patch and the name of the
patch, of course.
(26:22) Sorry, this one. So, this option must be set to false, keep
this in mind. So, now we'll create (26:34) the AMI patches,
perhaps let's have a look at the boundary file inside the
polymesh.
Now, (26:44) the master and slave patch are of type patch, so
this is a generic type, (26:53) which cannot support the cyclic AMI
boundary condition. (27:01) Yeah, now let's run the create patch,
I don't remember if I have to, yeah, (27:22) create patch override,
let's load the OF6, okay. So, adding new patch master
AMI, (27:38) adding new patch slave AMI.
So, now let's go again inside the constant polymesh folder
and (27:47) let's have a look at the boundary file. So, we'll see
that the slave and master patch disappeared (27:56) and instead
master AMI and slave AMI are created. You can create them by
hand as well, (28:06) yeah, it's up to you.
In order to have an automatic application, I prefer using the
create patch, (28:17) but the result is really the same. So, now
that we have those two patches with type cyclic AMI, (28:32) we
can use as a boundary condition for all the variables across these
two patches, for example P, (28:41) the type cyclic AMI boundary
condition and we have to put value internal field and this is the
same (28:50) for all fields because here there is not really a
boundary condition, it's more a way of calculating (29:01) fluxes
across this interface. So, what the, let's say, the arbitrary mesh
interface does is (29:14) non-conformal treatment of the mesh at
the interface.
So, let's try to explain this. (29:24) So, OpenFOAM generally
works with conformal meshes, does not support (29:32) non-
conformal mesh treatment unless you use this boundary
condition. So, you'll see that here (29:39) you have, for example
here, there is not, (29:48) one face is not connected uniquely to
one, one cell is not connected uniquely (29:55) to another cell by
one face, but for example,

Rotating mesh simulation


project tutorial in OpenFOAM
(mesh and simulation)
(0:00) Hello everyone, this is Jozef Nott here and today I am
bringing you the tutorial with the rotating fan (0:10) case that I
promised you during the CFD summer series here. I brought you a
short video where (0:17) I wanted to draw your attention to a new
tutorial that I contributed to the openfoam.com version
of (0:24) OpenFoam and now it's time to do the tutorial. I'm not
sure whether this is going to be a one (0:32) part tutorial or two
or three part tutorial, you'll see how many videos I upload.
Okay, so (0:39) I have not prepared anything for this for a very
good reason because I want to just go through with (0:47) you
guys and stumble upon possible problems that you might face
that I wouldn't if I don't go into (0:57) this blind and I really like
this approach because I do the same thing on Patreon so if you go
for (1:05) example to my channel here is my Patreon link where
you are I would really appreciate if (1:13) you like my videos and
you could support me just go through the tiers then and what you
get for in (1:20) the different tiers but what I want to tell you here
is that I started doing these blind tutorials (1:26) so for example
here with CFMesh or SnappyHexMesh creating your geometry. I
have a couple of (1:33) tutorials as you see 18 videos and I
started here these blind tutorials where I go into them (1:38) and
just go along with you and step by step and I show you how you
can create a mesh for example (1:47) and with this I stumble
upon possible things that I wouldn't find if I prepared
it (1:55) beforehand. So this is what I'm going to do also today so
to find the links to this tutorial with (2:05) the rotating mesh I
provided you two links one is the wiki page where you can just go
to the (2:13) tutorial page of the documentation or you can go
directly here to the case files (2:21) or alternatively you can go
directly to the tutorial by clicking this link without going (2:30) to
the wiki as you want.
Okay so this is the tutorial and we'll go through this
tutorial (2:37) that I as you see here contributed to
OpenFoam.com and to the documentation documenting the
rotating (2:46) possibilities rotating mesh possibilities in
OpenFoam with AMI and first what we will do is (2:53) download
the case file and as you see here this is on
develop.openfoam.com and this is the tutorial (3:04) as it comes.
So currently the only possibility to download is to download the
entire development (3:11) source code of OpenFoam but it is
currently September 2019 so if you already have version (3:20) in
1912 so if you're watching this tutorial in 2020-2021 then you can
just go into your current (3:28) OpenFoam.com release and then
go to tutorials incompressible pimple foam arise and then
into (3:35) rotating fan in room and you don't have to download
anything because this tutorial will (3:40) come with the
OpenFoam.com version unfortunately not with the .org
version (3:48) but with the .com version you can try and
download it anyway and then run it with the .org (3:53) version
but maybe you have to do some syntax changes there. Okay so
as you see I've downloaded (3:59) not the entire source code and
what I will do I have as you already might know I have a
symbolic (4:07) link here in Windows 10 to my Windows file
system and then I put my files into my Patreon (4:16) files and for
whatever reason and it is rotating fan and here I will now start the
tutorials.
In (4:28) video I record now this video so that's not very
interesting for you guys. Okay so then let's just (4:37) copy from
the downloads the OpenFoam zip file into my rotating fan tutorial.
We will not (4:47) compile OpenFoam hopefully you already have
OpenFoam installed on your PC or laptop.
If you (4:55) don't then check out my videos how to do that here
on YouTube and also in Patreon I have videos. (5:01) Okay so let's
just copy it so in Windows 10 you have to go to your C drive and
then your user (5:09) account and then downloads and then it is
called OpenFoam plus develop zip so as I mentioned
you (5:19) can skip this part if you're watching this in 2020 and
now all you have to do is come on Explorer (5:29) X and here you
have the zip file and you have to now extract it. You can do it in
Windows (5:36) or you can do it here in Linux if you're following
along in Ubuntu or Linux just (5:43) enter the same commands in
the terminal that I do here so extract with 7zip come on
OpenFoam (5:56) and now this takes a while so because we are
extracting not the entire source code of OpenFoam (6:04) but
let's wait.
Okay what do you want for make files we don't care about that so
always do that (6:15) we only want to take a look at the tutorial
here. Okay so in this tutorial we will take a look at (6:23) a
rotating fan tutorial that is now currently available only in the
development version of (6:30) OpenFoam but with 19.12 you will
also receive it out of the box.

Geometry:
So here is an overview what we (6:39) will do today we will take a
look at the geometry I already prepared this geometry as a set of
STL (6:46) files you should have it already prepared in Trisurface
all the STL files I also have the (6:54) Blender files available for
you guys and then we will go through Snappy Hacksmash the
settings (7:01) that you have to take care of in Snappy
Hacksmash and then the boundary conditions and the
similar (7:08) additional setups and then we will run the
simulation and at least for a little bit because (7:14) the
simulation does take a little bit longer so you can just run it for a
longer time and take (7:22) a look at the results at a later point of
time.
Okay so this is the plan today and I do think (7:32) that I will split
this video into separate videos. Okay so it's 46 so we have half of
it already (7:39) extracted good so let's wait until this finishes and
then I will just only copy the (7:54) from tutorials incompressible
maybe it's already here RIS and rotating fan in room oh it's
already (8:04) here so I can just copy this and then paste it
maybe here ah and now we have the rotating fan (8:13) in room
very good so okay so it's already finished at this point very good
so let's just jump into (8:25) the tutorial so in rotating fan in room
you have these files maybe I just show you here in
Windows (8:33) no this is what I wanted okay so what do you
have here you have an all run script for the (8:39) mesh
generation you have an oral script to run the simulation and then
you can clean to get this (8:46) state of the tutorials in 0.orig you
have backup files for the starting files and in constant
you (8:56) have your stl files and later on the tutorial files and in
system you have all the settings (9:03) that you need for meshing
and for the simulation now you can just run all run and then it
runs (9:12) for you and you don't have to understand anything
but I would not advise you to do that and what I (9:19) would
advise you to do is to use my suggested setup of the simulation
with geometry mesh and (9:28) case so for that I will do that you
can work in this rotating fan tutorial but I would advise
you (9:36) to create here a geometry folder geometry folder and
then take this as a backup and then place it (9:55) here as a
backup if you are a blender freak like myself then you can open
this up in blender (10:02) you don't have to for this tutorial so you
can modify this geometry in (10:08) blender as you see here this
is what the geometry looks like maybe let's just take a look at it
in (10:13) in blender so I exported the surfaces as stl files which
you can see here so this is the geometry (10:22) and we have a
room.stl this is the gray the walls I have in the room a
desk (10:38) what is a brown desk and then I have an inlet and an
outlet which I call door and (10:50) and outlet okay I could have
called it window but it's called outlet here and I have an stl
file (10:58) for the ami surface so this stl will define the surfaces
where we will interpolate between (11:06) rotating mesh and
stationary mesh and then I have a geome an stl file for a fan
which I (11:15) created myself so sorry for this huge blades but
oh well okay so I exported this this stl files in (11:33) from blender
and if I open it up in para view let's just do this my documents
and patreon (11:46) rotating fan and then here in geometry I can
load all this (11:55) apply and there you go so this is what I just
showed you room and then the geometry here okay (12:03) so
you now believe me that this is the geometry that we will take a
look at good now as the second (12:10) step I would advise you to
create a mesh folder and in mesh you need system and constant
so I (12:22) copy this and I paste it into mesh okay so
then (12:32) I go into mesh and (12:37) usually I have a dot form
file here but for an official open form tutorial I have to (12:44) use
a certain syntax with this all run scripts and there is no dot form
file (12:50) so you can adjust it as you can adjust it now as you
want and what I will do I will create a form (12:58) file with the
command touch and I will call it call it open dot phone and now as
you see here (13:08) we have this dot form file and I know I used
to call this phone dot phone but now I think it is (13:14) a better
idea to call it open dot phone because with this you can open up
the mesh and later on (13:22) the case files and also if you want
to do then you can just use this open dot phone file
because (13:32) this is just an empty text file and you can just
write here inside your cheat sheets of commands (13:39) or your
ideas what did you change what was the last thing that you
changed so you remember later (13:50) on so you can use this
and save with ctrl o and then you have it all for always in the
open dot (13:57) phone file you can you can which you can just
open up in any text editor okay so now as for (14:07) the machine
so let's just go back here so the geometry I already showed you
the geometry we (14:13) have a door a window called outlet then
a desk rotating fan and cylinder defining the cells (14:22) inside
which are rotating and also additionally defining an interpolation
surface between the (14:28) rotating and the non-rotating sense
but now what that really means we will see in the mesh
part (14:35) so for that for the mesh we execute a couple of
commands and you guys always ask me about (14:45) the tutorial
on snappy hack smash this is a very good source for snappy hack
smash (14:52) so if you want to take a look at it you have a quick
reference here which is great (14:58) and also here you have
more detailed descriptions of all the settings so this (15:05) is
really really great okay so but snappy x mesh is not the main
focus here (15:12) we now execute these commands in block
mesh okay so I'm not going into a lot of detail
surface (15:20) feature extract and I will just with the right mouse
button paste this command here (15:29) and there you go what
what did I do here I did here I used the entries from this
dictionary (15:39) I open it up and here I extract the from the stl
files edges and maybe I can show you so for (15:50) example in
constant I recreated this external feature edge mesh and this
created (16:01) external (16:04) feature edges which we will find
also here emeshes and these are actually for example here on
the (16:14) desk these are actually the edges of this desk so
these sharp edges for more detail I would really (16:26) advise
you to if you're interested as in supporting me to go and take a
look at my (16:32) snappy hack smash tutorial because I talk in
more detail on this okay so then so with surface (16:41) feature
extract we extracted these edges the sharp edges and we could
refine only along these edges (16:54) but additionally we will also
refine close to the stl files themselves okay so for that we create
our (17:04) initial block mesh by using this command called block
mesh I have a video on my youtube channel (17:14) it was my
second video ever how this works and now if I open up in mesh
open.foam (17:27) and don't skip zero time then now you see we
have a block mesh around it this is our starting mesh (17:34) and
we will refine this mesh around the stl all the stl files and also the
emesh files the edge (17:42) files and we will then define what is
inside of our domain and what is outside and then we
will (17:50) throw out everything that is outside okay so for this I
could open up block mesh dictionary and (17:58) if you want to
know more detail then just check out my youtube video on block
mesh (18:03) okay as for snappy hack smash what I am doing I'm
loading all the stl files (18:09) I am defining certain levels so I'm
defining level two and level two around the ami
surface (18:20) so which means this cylinder as well as the fan so
here I use a rather fine mesh (18:30) along the edges and then
later on here also on the surfaces the stl surfaces that I imported I
also (18:38) use level two here I would advise you to use a level
three on the ami and the fan to have a (18:48) good resolution
there and you are welcome to use also a higher resolution
everywhere else (18:57) and yeah so for example we could also
define inside of the ami surface everywhere level three (19:06) if
we commented this out but I'm not going to do that because this
is a tutorial and then it will (19:11) take a long long time but I
encourage you to increase the refinement along the
especially (19:18) the ami and fan and then you can feel free to
use also fire mesh around the desk and so on (19:26) so and with
this command with the location in mesh which is a
point (19:30) somewhere inside of or inside of the walls here we
define the inside and everything that is outside (19:40) so which
is outside of this room.stl will be thrown away and you will see
what will happen in a bit (19:48) for that I execute snappy hack
smash minus overwrite enter and now snappy hack smash
is (20:02) running maybe as a disclaimer currently I'm using open
form version 1906 okay but if something is (20:16) changed in
later versions in the syntax then as this tutorial comes with the
official open form (20:24) release you don't have to take care of
the syntax changes anymore okay so we are finishing
the (20:38) smashing stage so already the coarse mesh takes a
bit longer but now we should be finished with (20:52) 134,820
cells which is not bad and now so this was our initial block mesh
and if I refresh this now (21:01) and if I zoom in a little bit now
you see that something changed here and now we have
different (21:15) surfaces so this is our ami for example then we
have a desk surface as you see here we also have a (21:27) fan
here inside so as you see now we have the mesh created with a
certain refinement level (21:37) and maybe I show you only the
fan so this has level two and as you see it's not a very
fine (21:47) mesh you only have two cells over the thickness so
as I mentioned I would encourage you to use (21:54) a finer mesh
and now you see why I use such thick blades for this so we can
also run a coarse mesh (22:01) now for this tutorial and for a real
life application for your real life rotating mesh (22:07) I would
really advise you to use a finer mesh good so that's it so we have
now our mesh created (22:15) with these commands that you find
here surface feature extract block mesh and snappy hex
mesh (22:20) and there are actually there is actually one
additional important point that we have to talk (22:26) about here
in snappy hex mesh and this is here in the refinement surface we
define (22:34) two entries here or actually three lines so with this
entry with the ami stl file we not only define (22:44) an internal
boundary we also define with a level two refinement we also
define a cell (22:52) zone called rotating zone now this is just a
name I could call it blah blah blah but with this cell (22:59) zone
we select maybe let me just show you the entire mesh and then
create a z normal cut and (23:17) don't triangulate don't show
and so as you see here now there is (23:25) this line and this is
given by the s no this line here (23:34) this surface this is just due
to snappy hex mesh and here we define our ami stl and
everything (23:42) all the cells inside of these faces here which
we define with ami stl all the cells will be called (23:55) rotating
zone and additionally we define faces which we can show here so
these faces here (24:10) are also called rotating zone I could have
called it rotating zone faces or something (24:16) it doesn't really
matter but with this we select first cells and second faces for the
simulation (24:27) later because these cells will be rotating so we
will move only these cells inside of the stl file (24:34) and we will
use these faces to communicate between the internal faces and
the external (24:42) faces which are not moving okay so this is
this entry is crucial for rotating mesh simulations (24:53) okay so
these were now the commands and now if you are really fancy
then we so (25:04) as I said this defines a cell zone called rotating
zone which we later (25:08) define rotating cells and we define a
boundary which will be later used to define
interpolation (25:15) faces between rotating and non-rotating
regions just what I told you and now we could
renumber (25:21) this the mesh no that's not what I wanted this
always happens to me so I copy this command (25:30) and this
just renumbers the mesh so it runs faster and for better
calculation (25:39) performance and this command converts the
ami mesh interface converts the boundary ami into (25:50) an
actually an interpolation surface so for that create patch
overwrite and what this does is (26:02) you create patch it takes
ami and then creates a cyclic ami out of it so you don't really
have (26:10) to understand what this means the important point
is that here in constant polymesh and boundary (26:17) so we
have our door for example the fan and they are all defined as
walls for for clarity we could (26:26) redefine this into patch
because the door is an inlet and or outlet should also be
patch (26:37) really but this is not very not really important but
so we have a clean setup we just redefined it (26:44) and then
here these two ami1 and ami2 are cyclic amis and these are
copies of the same faces here (26:56) and we will
define (27:01) we will use these surfaces to communicate
between the internal and outer surfaces okay (27:13) so the mesh
is finished and what we now can do we can now go into the case
but we don't have a case (27:23) folder so this is now I create a
folder called case and I just copy system constant and
zero (27:33) orig here and now let's not forget to copy the mesh
so polymesh from the mesh folder into case (27:42) constant and
polymesh and now we don't need the tri-surface folder anymore
because we are not (27:51) creating a mesh anymore and in
system we don't need block mesh dictionary create patch
dict (27:57) snappy and surface feature extract just distracting
here and now we create a copy of (28:07) that maybe let's do it in
terminal so now we have an actual case setup with zero constant
and system (28:20) and again we create a foam file here and now
we have a good setup so in this orig file we have (28:30) a
backup files okay so let's just take a look at the initial files we are
using pimple foam so for (28:42) that we have to specify the
pressure and the velocity and since we are using a turbulence
model (28:50) and we also have to specify a couple of turbulent
entry entries and for example for the velocity (28:58) always the
AMIs are cyclic AMIs from the type then the fan has a moving wall
velocity because it is (29:07) moving and no slip boundary
condition has to adjust it accordingly the door we have a velocity
of (29:15) inlet velocity of 0.1 entering the room so for example
let me just show you the room and the door (29:24) and so it is so
the door is going in the negative x direction and this is why
the (29:31) velocity is also pointing in the negative x direction at
the outlet we use a typical boundary (29:37) condition pressure in
that outlet velocity and on the walls and on the desk we use the
no slip (29:43) boundary condition as for the pressure and this is
not the pressure in pascal but the pressure (29:49) divided by the
density if you already know the so-called kinematic pressure
because (29:55) we are using pimple foam which is an
incompressible solver but also

Basic Dynamic Mesh Tutorial


OpenFoam
hi this is the open room tutorial for
0:03
how to make a dynamic mesh in order to
0:07
follow this tutorial you're gonna need
0:08
to know the basics of open phone and the
0:11
general parameters we're going to use as
0:13
well as how to use the basics of the
0:15
block mesh snappy hex mesh and we're
0:17
using a way to create the blockmeshdict
0:19
files as a for macros and that's pretty
0:24
useful that's going to be partially
0:25
explained but some background on that
0:27
it's gonna be necessary
0:29
while we're actually covering in the
0:31
video is a cyclic ami the arbitrary mesh
0:35
interface and this cell zone and how to
0:39
specify what moves in a dynamic mesh and
0:42
then we're gonna run it go through some
0:46
examples change it as we go and then run
0:48
it the initial mesh will look like a
0:50
cylinder and cross flow this is only
0:52
done to demonstrate static mesh before
0:57
we move on to a dynamic mesh so we can
1:00
show you what changes need to be made in
1:02
order to actually make the dynamic mesh
1:08
that make mesh command was a bash script
1:12
that we need to use in order to actually
1:15
create the blockmeshdict file here with
1:18
this m4 macro and then run it the mesh
1:24
that we just made looks like there's
1:31
right now we're not actually running the
1:35
part in the center here this is a this
1:39
bounder here's a wall right now it's the
1:42
same as the top and bottom walls so the
1:47
fluid really just flow around the
1:50
cylinder here they'll come in from this
1:52
Inlet then exit here and it'll go around
1:56
that cylinder we'll show you that now
2:09
what we just did here is Randa the like
2:16
this like it's a regular wall you'll see
2:19
now that it does follow around the
2:23
proper pattern
2:24
[Music]
2:29
this gap right here no fluid flows
2:32
across it this is the first problem as
2:34
as this inner region moves it's going to
2:38
have to talk to the outer region and we
2:42
can't do that because the points will
2:43
just slip right past each other and you
2:48
need some way to get those these two
2:49
faces to be able to talk and then
2:51
recalculate which faces are talking to
2:53
with the other faces at each time step
2:55
this is critical and this is called the
2:57
cyclic ami we're gonna do that now we
3:02
clean what we just ran was all clean
3:04
that's run and make mesh anyway
3:06
that was unnecessary I just wanted to
3:08
make that clear we're gonna make the
3:10
mesh again this is the same meshes
3:13
before I'm just using it as a example
3:20
again
3:29
am i one right now is a wall you can see
3:34
it in the black mesh dict file
3:58
fluid does not cross this gap this is
4:00
what we're changing right now in order
4:02
to make these two boundaries right here
4:06
am i 1 and am I to talk to each other we
4:09
have to change that in block mesh it's
4:13
done like this we change this part to
4:16
cyclic ami we next say a neighbor
4:22
neighbor patch is am i - so we know
4:27
which patch which cyclic ami patch is
4:32
going to talk to
4:47
we applied this same thing we change
4:50
this am i - to a cyclic am i as well and
4:54
change this neighbor patch to 1 because
4:57
this am I - tox - am i one that's what
5:02
we're doing that's the point of changing
5:04
all this we're also changing the initial
5:12
conditions to change it from a wall to a
5:15
stick like am i if this am I was no slip
5:19
as it is right now the thing would crash
5:21
its it needs to be needs to be of type
5:25
cyclic ami and have a value of its
5:30
internal field if we're not applying any
5:33
sort of special condition
5:40
so we just say hey this is all this is
5:45
all what it's calculating at those
5:50
positions they just need to talk to each
5:52
other
5:59
and since it's all the same we can just
6:03
copy-paste this exact same boundary
6:04
conditions on pretty much whatever kind
6:09
of variable you're using whether it's
6:11
pressure or nu or K epsilon K Omega K
6:16
whatever it's always going to be unless
6:19
you want to enforce some sort of
6:21
difference like a pressure difference
6:23
over the AMI
6:24
but for our purposes it's always going
6:26
to be internal field
6:40
yeah
6:45
now when we run it
6:51
now when you run it it should be able to
6:53
talk to each other and I'll be just a
6:56
single block and cross foe and cross
6:59
float a much smaller block this um now
7:07
when we open this up be able to see that
7:10
it's that there's continuity over the
7:14
entire of the entire section even across
7:19
this gap right here that's because the
7:25
cyclic ami allow the allows these phases
7:27
to talk to one another the mi is the
7:30
patch weights are calculated once at the
7:32
beginning of the at the beginning of the
7:36
program and then this face is talking to
7:39
that face this face is talking to these
7:41
three faces this face is talking to
7:43
these two faces its recalculated each
7:47
time that's what's important about the
7:48
cyclic ami allows different faces to
7:51
talk to one another even as they move
7:55
this gap right here doesn't matter it
7:57
can talk across it we're gonna close
8:00
that gap later on in the video just
8:01
because it's ugly and it doesn't really
8:03
add anything to the computation it's
8:05
used there purely so it's easier easier
8:07
to visualize what the ami is two
8:10
different patches connected in the
8:11
blockmeshdict five dict file so that
8:13
they can talk to one another everything
8:15
else about this simulation is completely
8:18
ordinary this is still a static mesh
8:19
because nothing's moving next thing I do
8:22
is we're going to clean the case just to
8:25
make things easier to visualize then
8:27
we're gonna go here and into the dynamic
8:30
mesh dictionary and just well confirm I
8:34
guess but the cell zone is rotor that
8:37
we're changing which is what's gonna be
8:39
rotating and that the rotational
8:43
velocity is omega and is a non zero
8:46
value and that it is in fact going to be
8:48
a rotating motion we're using solid body
8:52
so that the points don't deform relative
8:55
to one another
8:56
it's just the cell zone itself that's
9:01
rotating
9:02
we'll try and run this now it won't work
9:06
because we didn't define ourselves own
9:10
yet so well we can create the mesh MIT
9:20
but now when you try it we are unable to
9:23
find cell zone rotor we have to define
9:26
that in block mesh this is one of the
9:28
two things we have to do we'll do that
9:32
now
9:36
in black mesh
9:47
we define it right after the hex 2d or
9:50
that the hex I guess I'll show you what
9:55
that looks like in a regular black mesh
9:56
file after we make the mesh just so you
10:00
can do it without the macros this m4
10:02
file is not necessary at all it just
10:05
makes things a lot easier to program and
10:08
use now when you make the mesh and check
10:16
this blockmeshdict file will see this
10:23
rotor after the hex right
10:29
this means that this block for which is
10:32
inside the boundary ring is of the cell
10:38
zone rotor and when in run pimple dym
10:42
foam now instead of crashing because we
10:45
didn't define the cell zone
10:50
we'll check the results now to confirm
10:52
that it does what we expected to
11:02
[Applause]
11:07
see how this inside moves right here and
11:12
that the rest of it doesn't and there's
11:15
still continuity in between these edges
11:18
this boundary here these phases are
11:23
talking to these phases and it's at the
11:27
correct phases because we know it
11:29
recalculates it at every time step
11:32
see this am i creating and addressing
11:34
weights between 80 source phases and 160
11:37
target phases it does that each time it
11:41
recalculates this interface at each time
11:45
step which is necessary because it moves
11:47
at every time step this is the simplest
11:52
explanation for the cyclic ami for the
11:56
really the dynamic mesh I think this is
11:58
the simplest thing you can do while
11:59
still hitting all the elements there are
12:01
more complicated things but that isn't
12:03
covered in the scope of this video the
12:06
next thing we'll learn how to do is how
12:08
to do all this not in block mesh let me
12:10
stop the X mesh it's a little bit more
12:11
complicated this case file is the
12:18
tutorial 17 and you're using it to show
12:21
you how to make a cyclic ami in cell
12:24
zones in snappy hex mesh right now we
12:28
haven't done that
12:32
and it's gonna look pretty much like the
12:36
block mesh we had before public of how
12:38
but because of how snappy works this
12:40
initial one
12:41
this initial mesh won't have anything in
12:44
the center
12:45
it'll just be completely empty like this
12:52
we still have we still have STL files in
12:58
the center here but because they're
12:59
outside the outer boundary for the
13:01
rotating region we don't see them yet
13:04
because we haven't implemented the face
13:06
zone type and we aren't actually looking
13:13
inside here yet we're gonna run this
13:17
case
13:22
we can still see
13:27
that the
13:30
meshworks pretty much exactly
13:36
the mesh looks pretty much exactly the
13:37
way it did before in terms of static and
13:40
sort of the static mesh it's because
13:43
it's really the same thing it's just
13:44
that the mesh is a tiny bit better
13:46
because it's more regular on the
13:49
outsides and it's more defined close to
13:51
the boundary we're gonna clean the case
13:59
take a look at snap the hex mesh and
14:01
prepare it for the cyclic ami the first
14:06
step is type this right here face zone
14:12
inner cylinder
14:20
now we're gonna make the mesh and see
14:23
what that does
14:36
see right now how we mesh the inside
14:40
this ami one that's changed that was
14:44
changed in the crate patch dictionary
14:46
but that was the M inner cylinder patch
14:51
that's just right here that is just the
14:54
boundary where we had a gap before we
14:57
now have two patches that are pretty
14:59
much exactly on top of each other that's
15:03
important because we're gonna have to
15:04
use this inner cylinder slave in order
15:06
to make the second part to make ami to
15:10
the second part of the cyclic ami we're
15:15
gonna do that in the crate patch
15:17
dictionary we're gonna change this ami
15:23
one which was the wall into the cyclic
15:25
ami which it we want it to be we're not
15:28
to do the same thing this looks like the
15:30
same thing in the block mesh you're
15:34
defining it pretty much the same way
15:35
just in a different place which makes
15:40
sense I think
15:46
and since we have both the ami one and
15:51
am i - you can just copy that it all be
15:55
the same except for here here and this
16:00
am i - is created from the slave patch
16:04
that's important yet there has to be two
16:10
different patches to be created from
16:11
which is what we did with a face zone
16:13
and this is how you put that in these
16:16
have to be different that's what I'm
16:18
trying to say we also change the zero
16:24
second file this has changed the same
16:28
way as in the black mission video I
16:32
shouldn't come as a surprise because how
16:37
the mesh is made shouldn't really affect
16:40
the initial conditions again this is
16:47
just the cyclic ami internal field we're
16:52
not changing any we're not pushing any
16:54
kind of pressure on the boundary we're
16:56
not going to change the boundary in any
16:57
way we just wanted to talk to each other
16:59
clearly so cyclic ami internal field
17:27
now that we got that other way we can
17:30
test it we're gonna make the mesh again
17:37
and then try running it from pimple foam
17:42
we can visualize this and powerful
18:04
and there you have it this is the inlet
18:06
this is the outlet the it's not moving
18:09
yet but these two different boundaries
18:12
do talk to one another and cyclic mi
18:17
works at least next up where do you hide
18:21
the cell zone to snap the exomesh tipped
18:26
this is done in the same way in a
18:29
similar way to the boundary and this
18:31
refinement surfaces right here we
18:34
declare the cell zone to be rotor and
18:38
then we say that the cell zone is inside
18:43
the the stl the inner cylinder STL file
18:51
simple as that and now we just need to
18:56
ensure that the dynamic mesh dictionary
18:58
is all done this this is the exact same
19:01
dynamic mesh dictionary that was in the
19:02
block mesh that's no surprise so is the
19:06
zero dot original original zero file
19:11
okay we'll make the mesh and then we'll
19:18
make sure this works with pimple dym
19:20
phone now we'll check this in Para phone
19:38
it's moving and there is a conversation
19:41
happening between the edge of the two
19:43
patches this is exactly what we were
19:45
looking for
19:46
snappy hex mix snappy hex mesh did the
19:49
pretty much the exact same thing as
19:50
block mesh just with a more regular mesh
19:53
on the outside and better defined
19:56
boundary on the inside we're now gonna
20:00
use snappy X mesh for something that
20:02
really couldn't be used with block mesh
20:04
you know that's the last part of the
20:06
video be demonstrating a baffle valve
20:09
done using the exact same techniques as
20:12
the much simpler case this is the
20:15
tutorial 18 we're gonna make the mesh
20:29
nowadays paraffin
20:45
this is the valve this will rotate
20:49
counterclockwise in order to close off
20:52
this section here and force the fluid
20:55
through a much tighter boundary so it'll
20:58
speed up there this snappy exomesh file
21:07
is everything's already set up for the
21:10
the dynamic mesh we don't have to change
21:12
anything it's done the exact same way as
21:15
it was the previous time feel free to
21:18
inspect whatever you want inside the
21:21
snappy X mesh or the Create patch or the
21:23
topo set it's all it's all there
21:31
and since it's all there we can run it
21:37
with pimple dym phone we elected not to
21:42
do this in parallel because we didn't
21:45
think that was you know be covered by
21:47
the scope of this video but it can be
21:49
it's not that much harder
22:00
the inlet is up here there are two
22:02
outlets one with a much smaller width
22:05
than the other one
22:19
you can see now that this is indeed
22:21
moving there is continuity between the
22:24
border everything looks like it should
22:38
this barrier here is really just the an
22:44
absence of cells
22:52
we're gonna go ahead and view this a bit
22:53
differently with the slice and then
23:11
applying the glyphs so we can see what
23:14
direction the flow is in
23:59
see how there's that vortex right here
24:01
that was made it through the boundary
24:04
same here everything communicates the
24:09
next step in dynamic meshing which is
24:11
not at all covered by this video is how
24:14
these if you had two interlocking
24:16
dynamic meshes and you couldn't have a
24:20
solid body rotation unisys it wasn't as
24:23
if necessarily deforming the points
24:25
that's much more complicated and will
24:28
usually require Ramesh's at every time
24:30
step luckily we not we don't cover that
24:34
I don't feel that's absolutely necessary
24:37
but it is quite difficult and once
24:42
you've mastered this that is the next
24:43
step

Overset mesh simulation project


tutorial in OpenFOAM (mesh and
simulation)
hello everyone this is your jeff knight here and in this video i would like to
0:15
bring to you a new tutorial about overset meshes with a little bit of a
0:20
twist compared to the other over set tutorials okay so first things first
0:26
let's get the tutorial case for that we go to wiki.openfoam.com
Getting the tutorial files
0:35
and then we go to the tutorials here and then we scroll down to the
0:41
collection by contributors and then we look for my name here and
0:46
then the faux set and sync tutorial it has been online now for a while
0:54
and i already recorded this tutorial but the quality of the video was not the
0:59
best and i wanted to give you the best quality so i am now re-recording
this tutorial
1:05
again with hopefully a better quality okay so here you will find the
youtube
1:12
tutorial that you are currently watching and yeah so here's a short
description
1:20
and what we need is we have to now go to my github account where we
can download
1:28
the zip file of this tutorial to just click download then we have this
1:34
now once we have this you downloaded this please extract it and then
place it wherever you want to
1:41
have your tutorial okay now i downloaded and extracted
Initial thoughts
1:46
the faucet and sync zip file and now i can go into it and there i have now
1:53
a couple of files so you can you have an all run script and also an all clean
1:58
script and then you have two folders and if you're lazy just run the all run
script and then
2:04
there you have the tutorial results but here in this video i would like to go
through those steps
2:10
uh the script step by step what and explain you what are those two
2:17
folders and how you run the simulation and why those steps are
2:22
required okay so first things first maybe let's just open
2:27
up these two scripts and then take a look at what they do so the all clean
script
2:34
just goes into those subfolders and then executes all clean in the
subfolder
2:40
so nothing fancy here and then what the oran script does it goes first
2:46
into the folder called overset mesh runs an all run script dot
2:52
pre there then it switches to the background folder
2:57
there it executes another all run script and then you can choose whether
3:04
you want to run the simulation in serial or in parallel so here you can
change it
3:10
i chose the parallel application because it's faster but that's that's all it is
so now we
3:16
have to take a look at what is what are these all clean scripts and what
are these two all
3:22
run scripts and what do they do okay so first we go into overset mesh
Overset mesh setup
3:31
there we have these two scripts so the all clean script does nothing
3:37
else than the usual all clean scripts it cleans your directory it resets it
3:44
to the current status that you can see here so
3:50
we have a constant a system in constant we don't have anything and we
only have some system
3:57
files so this is the default uh configuration in the overset
4:03
folder and then we execute a couple of
4:08
commands open from commands so first i create an open.form file so this
is
4:15
nothing open form specific this is my uh my way of doing things that to
create
4:22
this dot form file and call it even open dot form because in my opinion it
just makes sense
4:28
and then we start with a block mesh then we run a couple of additional
4:36
commands but let's take a look at first uh block mesh okay so what do we
have
4:43
in block mesh dictionary okay so we have eight vertices
4:50
which define one block and as you can see it's a 2d simulation
4:55
the z direction we don't have a resolution and then what we have
5:00
here we have three boundaries over set one whatever that means we will
take a look at it a
5:07
little bit later then a dummy boundary called hole and then the default
faces which are the
5:13
front and back planes just to define the empty direction to have a 2d case
okay so really nothing fancy
5:23
if i go back to this page this is why i have this uh um
5:30
these pictures here so here you can see the over kind of the overset mesh
5:35
yeah so this mesh that is on top of this background mesh
5:42
without the hole is or initial block mesh so if you don't believe me then
5:49
let me just fire up version 2012 and then go into my documents and
where
5:58
do i have it youtube over set tutorial and then
6:04
full sentencing photo sentencing and then over set mesh so here we are
and if i now manually just execute
6:12
the first command called block mesh
6:18
the first command was actually this one
6:24
okay so now what i do i will just open up paraview
6:33
click apply and as you can see it is nothing fancy it's just a block and it
has the shape of this
6:41
final overset mesh okay so nothing fancy now let's take a
6:47
look at the boundaries here default faces are the front and back planes
6:52
then we have the overset planes which are these outer
7:01
the four outer faces and then we have a dummy uh boundary which we
don't use at this
7:06
point but we will use it soon enough okay so this is nothing fancy it's just a
simple block mesh
7:13
we can now progress to the next step um maybe one important
7:19
point is that these four outer boundaries have to be of type or overset
7:27
already at this point
7:32
okay so the next command that we will execute is toposet
7:38
and for that we will use the dictionary in system toposet dict underscore
whole
7:46
so let me just bring it up so what do we do here so topo set creates cell
sets or cell zones
7:54
and cell sets and cell zones are selections of sounds it's like if you have a
gui and
8:00
then you drag your mouse around for example in blender you drag around
your your mouse around certain nodes and you
8:08
select them they have a different color than the other ones and then they
are stored in a
8:14
selection this is what we are doing here just without a gui
8:19
okay so what do we do here we have here three steps and then the first
step
8:26
is creating um something called box and then we will
8:32
select the cells inside and select all the cells with a certain coordinate
8:38
so this coordinate is inside of this volume then
8:45
we will clear create
8:51
then we will select only a small box
8:58
why do we do that so this small box is from minus 0.005 so let me just
quickly show
9:06
you possibly with the help of
9:13
okay so from minus 0.005 from this
9:18
plane until plus 0.005 so it's really in the center
9:25
and then we select uh in the y direction from plus 0.015
9:33
till 25 so if i now change this to y normal 0
9:39
15 so we start here and then we move up to
9:46
15 25 so we are selecting the cells inside of this box
9:54
and then we have only the cells inside of this box and then we invert it so
then we select only the
10:01
cells which are not inside of this box so we sell everything outside of this
box and the
10:08
idea behind this is to select only the cells and then
10:13
outside and then get rid of the the box itself and then this box
10:19
is going to be kind of a faucet a very simple faucet that then is used to
inject water
10:27
through and then fill up a sink so and then the idea here uh behind this
10:33
tutorial is that you do have over set tutorials which come with open phone
which are on the
10:38
wiki but all of them have a flow on the background mesh
10:43
and then the overset mesh only uh has volts which then um modify
10:50
the flow on the background mesh now what i wanted to do here is to
induce the flow on the over set mesh so
10:59
in the box have an inlet and then have the flow come out in the overset
mesh and then
11:05
this flow is that interpolated onto the background mesh and then induces
11:10
a flow on the background mesh okay so it's in this case it's not a flow on
the background mesh which is modified
11:16
here the flow is induced on the overset mesh and then creates a flow on
the background mesh so
11:22
let's take a look at that okay so i hope that i could visualize a little bit
what we
11:28
are going to do here so let uh let me then just execute this
11:34
command here okay so yeah so it selected the cell so
11:41
we have now 488 maybe the first step is not even needed
11:47
so we have 488 cells everything outside of the box and then
11:55
we execute subset mesh box patch hole and overwrite
12:02
okay so what is this uh so here we define a cell set called box
12:08
so we i want to create a subset mesh with defined by the
12:16
cell set box so keep all the cells which are in box and then create a patch
called hole
12:24
and then overwrite the previous mesh and this is why we already created
this whole entry to have a reserved seat for
12:33
or patch here okay so what this does um let me just show you copy
12:43
no that was not a good idea now copy now i can execute it and now it
created
12:50
a subset of 888 cells out of 512 and now if i get rid of the slice and
12:58
refresh it then now you can see that we do have a hole in our mesh
13:03
and now the whole boundary has faces in it so it's not empty
13:10
anymore so these are the whole boundary faces
13:15
okay so now we have an over set we have the front and back and we have
a
13:20
hole so cool that we can do that now in the next step
13:25
we use a second toposet command and don't worry about this minus s
and
13:31
minus minus s1 and minus s2 it just gives the run application command
the
13:40
number which number it should add on to the lock file because with run
application
13:46
the output is written automatically in a log file and then it's going to be
log.toposet.1
13:52
and log.set.2 for the second time so this is just this flag here okay so and
13:58
since we are not writing it into log file we don't worry about that
14:05
again copy and then topo set dot inlet
14:12
this had did more than just a couple twos or three
14:18
steps and let me just show you here what happened here sorry first
14:26
things first let's go it's better to open up the toposet
14:32
file so as you can see now we have one two three four five steps what do
we do here so
14:38
here we define a face set called boundary faces and
14:44
so before we selected cells now we are selecting faces and
14:53
and with the the function patch to face so look for a patch called
14:58
hole these are or red faces so they they are selected in a
15:04
selection then in the next step we are just
15:10
mirroring this selection and create a second selection called inlet faces so
we copy boundary faces
15:17
and create inlet faces and then from inlet faces
15:22
we create a sub selection a so-called subset and with the function normal
to face so
15:29
we only select faces which have a
15:36
normal in the positive y direction now which one are these so in open form
if you
15:42
remember back to my sec third tutorial which was about block mesh
15:47
um i mentioned that the normals always point point out of the domain so
15:54
in in the red cells so let's just get rid of the others so here we only have
16:03
faces with normals pointing in the positive y direction here in the bottom
so
16:08
one two three four five six cells which have a normal pointing in
16:13
the positive y direction and then you can have a tolerance we don't need
it because we
16:20
have a blocky structure here so we reduced our inlet faces to a selection
of these bottom
16:27
six faces and then we create a second set
16:34
of faces we just copy boundary faces again just like we did before and
now we subtract the inlet
16:42
faces from faucet faces so so boundary faces are all of them
16:48
then we make a copy of that so we in four set phases we have all of them
and then we subtract these six faces
16:56
from all of them and then we end up with a selection
17:01
called faux set faces uh which only include these four six and four so
17:09
in some 14 phases so this is the four set and this is the inlet of the faucet
or actually outlet but for
17:17
our domain and inlet and we with that we create a selection
17:23
for two phase selections phase sets and then these will be then
17:29
converted now into boundaries okay so this is what
17:34
we just did here so as i mentioned 14 faces in four set faces and six faces
17:41
in inlet faces and these are the two which we require
17:46
now so let's go back to the very last uh command called create patch and
17:53
create patch has its own uh dictionary yeah and then we have now
17:59
two we create two patches inlet one and four set and it will uh the inlet
has a tight
18:05
patch like always an inlet has a tight patch and the wall has a type wall
18:10
and we construct it from sets which we just created here and we will
18:17
a set is called inlet faces and the set is called photoset faces so these
names have to
18:22
match up with these ones so here you can select any name of your
18:28
choosing this is what you will then need in your boundary conditions so we
are creating inlet one and faucet
18:36
and inlet one is going to be comprised of these six faces and then the 14
are going to be
18:42
called faucet okay so so far so good
18:52
copy i did again the selection okay
18:59
so because pasting is a right click and if i have a selection here and i right
click then it's copies
19:04
so i lose my copy from notepad plus plus with create patch now we
created inlet one and four set
19:13
and now if i now take a look at those now i have
19:21
my inlet face and my faucet so well done and then whole
19:28
does not have any faces in it okay so if i just take a look at the mesh
19:34
about the boundary here we have the overset faces the empty faces and
then inlet and
19:42
one and faucet and then whole was automatically deleted so
19:48
very good so the first step is being done so in in this
19:57
in on this mesh on the bottom we will use this inlet to inject water
20:04
and then it will flow downwards in the negative y direction and then in the
along these over set
20:11
phases the results will be interpolated onto the background
20:19
and then so once it is interpolated then uh it goes onto the background
mesh
20:27
and for that we use this over set boundary for this interpolation okay and
then on
20:33
the background mesh the flow continues yeah so let's go to the
background mesh because this overset
20:40
mesh does not assume uh the same mesh resolution so you can use the
different kinds of of mesh
20:47
resolutions yeah so this is one of the advantages of
Background mesh setup
20:53
the overset method background mesh here we also have the two scripts
21:02
so in the the clean script just resets to its original form which means in
this case that we have
21:10
this zero.org which is a very open sponsor specific backup file and then
21:18
constant without any polymesh yet and then system with the system
21:26
settings okay but now let's go to the all run script here we have one two
three four five six
21:33
steps first we also create the open.form
21:40
file okay no so first go into background mesh the
21:47
open dot form file and then what do we do we execute block
21:52
mesh okay so what do we do here in block mesh dictionary we have 15
22:02
vertices and three blocks and we have two boundaries now just to
visualize it
22:10
i have um maybe that's the best uh picture to visualize it so what i have
22:17
here you already can see the three blocks so you have this upper block
with a certain resolution
22:23
then you have this middle block with a certain resolution and then this
bottom block
22:29
okay and this should be a 2d sink and i divide it up into three regions
because on the left hand side i wanted
22:36
to have the wall up until this point until the height of the second
22:41
block and on the right hand side i just wanted to have the height under
until the first block and my idea is to
22:48
fill up this uh sink with water and then on this side water can then spill out
and not on the
22:55
other side just to see that as asymmetric effect
23:00
okay and uh so this is going to be a wall called sink
23:07
and then the outlet is going to be the outlet here in the top okay so
23:12
nothing fancy uh and i did not specify the default
23:17
faces so the front and back play faces because this is very handy in block
mesh that all the faces that are not defined are
23:25
automatically put into default faces and since i use the same name on the
23:30
overset mesh they will automatically be merged when we merge the two
meshes okay so let's get rid of
23:37
this here okay so first things first let's just create the block mesh
23:46
here okay and maybe even load it
23:56
apply and now you can see that this is our background mesh with
24:02
the sink and the outlet
24:09
you can see sync and outlet and again default faces the front and back
planes
24:15
and our initial setup will look like that that or overset mesh is in the center
here i have it at a
24:23
certain point of time i don't even know by heart so yeah at 0.17 seconds
24:29
is the mesh and then something called cell types will come to that and
then the flow
24:35
at 0.17 seconds okay so so far so good
24:43
then let's go to the next step which is merge meshes what does this
24:50
it merges the two meshes and the syntax is that you have to define the
the first mesh and then the second
24:57
mesh now the second mesh is rather obvious so we go one level up and
then the overset mesh that we
25:04
just created and then there is this dot and this dot
25:10
is saying that in my current case folder where the this command is
executed take this
25:17
as the first mesh and then the second mesh is then one level up and then
down into over set
25:23
mesh and please overwrite my previous block mesh
25:29
okay let's just copy paste and now what happened now i will just
25:37
get rid of the overset mesh and re-fair fresh the mesh and now they were
merged they
25:43
are not connected this is very important so the overset mesh and the the
background mesh are not
25:50
connected and this is by design so like this because we will interpolate
25:55
between them okay so we will induce the flow on the overset mesh on this
inlet
26:01
the water will fall down and then it will be interpolated onto the
background mesh so
26:08
good so maybe we can just go through the boundaries here again
26:13
so we have this uh interpolation or the faces which then uh generate the
region of interpolation
26:21
then the inlet which is here then the faux set
26:26
and then the sink which is this bottom one and then we have the outlet on
the
26:34
top and these are the most important boundaries and then we have the
front and back planes
26:39
of course and then the entire so the internal mesh which not the
boundaries but the cells inside
26:46
of or mesh okay
26:52
good and now we have to do one last thing before we do then the
26:58
last thing uh which is topo set
27:03
copy and paste okay so this does one two three
27:10
steps let's take a look at what we do here so no it's four steps so we
27:17
create now a cell set called c1 which is a very non-descriptive name
27:23
well and we again put in a coordinate somewhere into the
27:30
mesh and this is somewhere inside of the the mesh and we select with
that
27:38
all the cells except the cells on the overset mesh so this only selects
27:44
cells on the background mesh because it is only part of the background
mesh
27:50
and then we create a second cell set c1 which is nothing else than
27:56
just a copy of c0 and then what we do we invert
28:02
the selection of the background cells and the inversion is of course
28:09
the cells on the overset mesh so c0 selects all the cells in the background
28:15
mesh c1 selects all the cells on the overset mesh
28:20
you will see why we need this and then c1 is converted into
28:27
a cell zone now and this is now the different cell sets are usually these
28:33
kinds of operations and then you can reduce some data to the mesh but
cell zones are being used for the
28:41
for the simulation as well so this is one of the major difference between
cell sets and cell zones basically they are the same they are
28:47
just used for different things and they grew just historically okay so we
28:52
created a cell zone which are all the cells on the over
28:58
set mesh and we call that over set zones and we will take a look at a bit
29:03
later where we need c0 c1 and overset zone
29:10
okay so let's go back to the command so restore
29:15
zero directory is nothing else than typing in cp minus r
29:21
uh zero.org and then just create a zero folder sorry so the zero folder and
now
29:28
we execute set fields okay what is set fields
29:34
what is in set fields dict so i hope you know what set fields is so the
default values that we will use
29:42
for a field called zone id is one two three and then for alpha voter
29:49
we will initialize everything with air it is an interform simulation a multi-
phase simulation if you don't
29:55
have any experience with that go to my multi-face simulation project and
you will know what i'm talking about
30:02
but then we se use we don't use enough books to sell
30:07
or cylinders to sell but rather sell to cell which then
30:12
uses the set called c0 so all the cells on the background mesh
30:18
and it gives them the zone id 0 and then c1
30:24
and gives so of the over set mesh and gives it a zone id 1. so this difficult
with this the
30:31
solver can differentiate between the different zones and then where to
interpolate and then
30:37
i also create a small lake in the bottom of water
30:44
on the bottom of the sinks just to have a starting level of water so just
30:51
just take a look at it so set fields enter okay and then
30:58
if i just now refresh it and then maybe just let's
31:05
reload that's possibly the best here alpha yes so as you can see i
31:13
started with a certain height and there are some visualization
31:19
problems here because paraview doesn't really understand this overset
mesh concept so it will show you
31:26
both meshes and then here they overlap and then set fields did reach
these
31:32
the center of this uh so it a paraview assumes that the cells are filled
31:37
the background mesh cells are filled up till this point and then the
background mesh is filled
31:43
up until this point this is just due to set fields yeah so
31:48
you can reduce this with the refinement but this is something that you
have to
31:54
assume and use and just accept if you use overset mesh which if the
32:00
mesh is not uh uh overlapping and not coincidental then
32:06
they will have these kind of small errors but this is what uh the initial flow
looks like so we will
32:12
inject water here and then this overset mesh will move in a certain
32:17
pattern and then we will see what the flow will look like okay so now we
could start the
32:24
simulation but first i want to go through the case setup as well
Case setup
32:30
so let's just go into zero orig because you already modified the alpha
32:35
file okay so the sync the faucet and the inlet are all zero gradient
32:43
um the inlet i'm not even sure why i have this inlet here
32:51
do we have an inlet here no it's just inlet one okay so this is a relic so
sorry about that you can just delete
32:58
inlet here so the sink and the faucet are walls where we usually assume a
zero aggregate
33:03
gradient for for alpha on the outlet we assume inlet outlet with a backflow
value of zero on
33:10
the inlet we use a fixed value of one and then over set one is of type over
set
33:19
epsilon and again over set is of type overset and you notice that the
empty
33:25
boundary condition in 2012 does not have to be defined anymore as long
as it's in the mesh and it's empty
33:32
that's fine you don't have to define it anymore okay and then the walls
sink and faucet
33:38
are for epsilon wall functions we use this fancy inlet boundary
33:44
condition where you uh define the turbulent intensity and also mixing
scale for epsilon
33:51
so we use a mixing scale of 0.03 we use inlet outlet at the outlet same for
k inlet outlet and then wall
33:59
functions and here we use an intensity of five percent for nu t
34:04
we calculate it at the inlet and the outlet we use wall functions on the
walls
34:11
and then for pressure so this pressure is so pressure p is prgh which will
come to
34:18
plus rho g and then the height so buoyant pressure effects and these
34:26
are this is calculated because we defined the boundary condition on prgh
which is just the dynamic pressure
34:33
induced by the velocity so on walls and inlets where we fix the
34:38
velocity we use fixed flux pressure and then at the outlets we fix the
pressure to zero to atmospheric
34:45
values point displacement so we have zero gradient on the inlet and
34:50
the faucet so on the boundaries inside of the over set mesh
34:56
over set is overset and with the type zero gradients so here we have to
define
35:02
something additional and all the others are uniform fixed values so it is
fixed value
35:08
so they don't move so the sink doesn't move this is what it means for the
velocity
35:16
okay let's go to zone id first so zone id defines the the id of the zones
35:22
to have to know about something about background mesh and an overset
mesh and so all the
35:29
boundaries are set to zero gradient and now we can go back to the
velocity because this is important
35:35
so for the sink i'm using uniform fixed value so this is fixed value zero zero
zero just
35:40
you can extend it to have more more functionality than the simple
35:46
fixed value then for the faucet you have to use the so-called
35:52
moving wall velocity you use that also in emi simulations if you are
rotating a
35:57
fan because you have a relative motion of your geometry of your mesh
36:03
and then this a simple fixed value zero zero zero would not do because
you have to account
36:09
for this relative motion of the mesh this works for
36:14
a wall where you assume 0 0 0 but it does not work for you don't have
The BC codedFixedValue
36:20
an out of the box boundary condition for inlets where you specify
36:25
the velocity in a certain direction it only you can only use moving wall
velocity where you assume a velocity of
36:31
zero zero zero okay so first at the outlet we use pressure inlet outlet
velocity and then
36:36
at the inlet we use a coded fixed value because this there is no such uh
boundary condition for inlets because
36:44
this is the first tutorial which uses an inlet on and over set mesh
36:49
because all the other oversight tutorials available online at least to my
knowledge and also in open form only have walls on
36:57
the overset mesh but now this is the first one to my knowledge again
37:02
which then also induces the flow so has an inlet on the overset mesh for
that we have to
37:08
program our own boundary condition you can do that on the case level
37:13
you can also implement it as a special boundary condition and just use
that boundary condition here so for that
37:19
we have to include a header file we have to include a couple of
37:25
libraries options and libraries and then we start
37:30
with the code so we have a couple of points here and
37:35
we i believe we don't even need all of them but let's just go step by
37:41
step so first things first i am defining my inlet velocity so this
37:46
is something like what i would write here so three values here i'm writing
0 minus 0.5 and 0.
37:53
so we have a velocity of 0.5 in the negative y direction so this is pointing
downwards
38:00
this is my inlet velocity i tested it this gave the best results at least to me
the best
38:06
results please feel free to modify it and then see what happens and then
we load the mesh in the
38:12
boundary condition then we uh look for the patch
38:18
that we are currently working on so inlet one and then we also load
38:24
the point the old points the previous points from the last time step
38:30
then we create a vector field which has the same size as the patch itself
38:36
and then we uh yeah we just copy the coordinates
38:43
and then we load the the delta t uh
38:50
the current delta t and then what we do is so we take the current
coordinates
38:57
of the inlet patch we subtract the old points
39:04
so for the the coordinates of the inlet faces from the last time step so this
is
39:11
s1 minus s2 divided by delta t is a velocity so this is
39:18
[Music] the length that the mesh went through
39:23
within a time step so length divided by delta t time is velocities and this is
now
39:31
the relative velocity of the mesh this up value and this is something that
39:39
we utilize here so uh i was uh discussing this with michael aletto
39:44
who helped me setting up this tutorial so thank you to michelle he also
has a couple of very interesting
39:51
uh tutorials on the wiki uh so and we discuss whether we need the normal
velocity we found
39:58
that we don't need the normal velocity so this is something that we could
get rid of here
40:05
so currently we only need uh the
40:11
the the relative movement of the mesh and uh which is here uh which is
here up
40:22
and uh and this constant vector and then this will calculate the relative
correct
40:29
relative inlet velocity that we require okay so this is the most complex
40:34
thing in this case tutorial this coded boundary condition but possibly you
can use it also for your problems
40:42
okay now only easy things are coming constant okay then
40:48
turbulence properties as you may have guessed given by epsilon and k we
are using the k epsilon model you can
40:55
modify it according to your needs and we are using here two phases it's
interfered simulation
41:03
water and air and we use the density and the kinematic viscosity of water
41:09
it's a newtonian fluid same with air and here we assume 0.0
41:16
i'm not sure why so we can just change it to the real value here or we can
just
41:24
you can do it on your own time we'll see what is the difference if you use
41:31
surface tension here more important is the dynamic mesh here and then
we have also gravitational
41:39
acceleration in the negative y direction so if somehow the water is then
pushed
41:45
up the gravitation will it pull it down again in addition okay so and now
dynamic
41:53
matchsticks so we are using the dynamic overset method and we are
using a multi-body
42:02
body motion solver which means that we could even use multiple over set
regions not just one
42:12
yes and now we come to the coefficients and here you see over set zones
42:17
so if i if you remember back here in topo set we created c0 c1 which we
used
42:24
in set fields as sets here we create defined sets and then we created a cell
zone
42:31
called overset zone and here now we define those cells
42:38
which then move so the overset mesh will move and the background
mesh will not
42:43
and i set up two functions a linear function which just goes from the
center to the side and then leaves the domain
42:51
that's not so uh interesting so i will just comment it out and then
uncomment
43:01
the second set of
43:07
of movement which is an oscillating movement so it goes to the left and
to the right and left to the right with a frequency of
43:15
30 and an amplitude of 0.03 this really nicely fits into the into the domain
if
43:22
you reduce it and it's lower if you increase it and it's faster play around
with this setting it does
43:28
make a difference next step is
43:33
[Music] these four because we already saw the
43:40
rest so fb solutions these are standard settings so i guess you can use it
43:46
if you have numerical issues then you can play around with the end
correctors here
43:52
or the tolerances but in my experience these work nicely
43:57
then here we have the discretization schemes you can see we are using
second order
44:04
scheme for the navier stokes equations fun layer fold for the alpha
equation
44:09
and then upwind for the turbulent values we are running on four
44:16
cores so if you don't have four cores just uh switch back to the serial
44:23
simulation which was in the very first all run script here so then just run it
44:29
on one core it will take longer okay so decompose
44:34
bar and then control dick the very last one we load the oversight libraries
we just use the
44:41
debug switches but that's not very important and we will use the solver
called over
44:47
inter dime foam so it is a dynamic mesh solver and overset dynamic mesh
solver and it
44:54
is a derivative of interform we will run it for one minute and we will write
out 100 time steps
45:02
and we have a max c of 1.5 so we are very brave
45:08
um and yeah that's that's about it so just just
45:16
copy no let's just run the
45:23
the parallel simulation okay so then we have now everything so
decompose
45:28
bar and then now it compiles
45:34
uh so it is very important that you have the compilers installed if you don't
have uh g plus plus
45:42
compilers installed on your ubuntu or in your vsl then install
45:49
g plus plus ubuntu so how do i install it it is
45:55
[Music] no that's not build essentials is what
46:00
we need build essentials
46:06
um yeah so here is just enter sudo apt update and then sudo apt-get
install build
46:13
essential and this will then install you the g plus plus compilers which we
46:19
need in order to build our own boundary condition that we just defined
46:24
here for inlet one here okay so yeah and now we can just run
Starting the simulation
46:33
not set fields enter no over inter dime form
46:42
i will write it into a log file called over inter dime form run it in the
background
46:49
and mpi run four processes okay now you don't see the command here
46:56
from my face but by moving it i helped it okay so this will
47:01
start an mpi process with four processors running over inter dime foam in
parallel mode and
47:08
then it will write the output into a log file and run in the background this is
the ampersand
47:14
no no like this okay now this runs the simulation in the background we can
47:19
tail it so we are currently at 0.01 seconds
47:25
we write out in 0.01 seconds so if i go into processor 1 we already
47:33
have a couple of time steps so i could just
47:39
refresh it ah decomposed case don't forget
47:46
and now we have a couple of time steps here and as you can see there is
some weird
Thoughts on cellTypes
47:52
uh thing happening and this is paraview the visualization that you
47:58
have two meshes or overlaid so what i usually do is first we have to
48:06
understand cell types okay so that's not the best way to understand cell
types uh because that's a bug
48:17
okay let me just show you the compost bar okay so this is a bug
48:24
this is not something should that should happen so let's just reconstruct
par latest
48:31
translate latest time
48:37
okay let me just open up this one time step here
48:45
so 0.13 and now yes so we have here um cell types we have cells
48:53
cells zero we have two and we have one so we have the green cells the
red cells
48:58
and the blue cells the blue cells are the normal cells where the calculation
is normal red cells are cells where we have a hole
49:07
so this is on the background mesh so in the red cells a hole is being
49:13
assumed on the background mesh and then in the green cells we
interpolate
49:19
between the overset mesh and the background mesh and what we this
means is that
49:26
um and uh this is why i meant that it
49:31
is a bug because uh in the decomposed case
49:39
it had this weird uh shape and if you reconstruct all the time step then it's
fine it's
49:46
just somehow in this decomposed case part of you views it this way but
49:53
so uh here on the left hand side it works well so i don't know why it
doesn't work on the right hand
49:59
side and it doesn't i don't even care uh so what we could do
50:05
what we can do we can now cut out the hole because the hole is a hole
and it doesn't interest us
50:10
so what i usually like to do is go to clip and then clip not by playing but by
50:18
scalar and then go to this cell types and then
50:23
let's say let's clip away all the cells which have a value higher than 1.2 so
all the red
50:30
cells yeah so that is it by inverting it it's already correct now
50:37
it's a 2d case so it makes sense to use parallel projection and
50:43
now we have it okay now we have it and it okay so in this case it really
50:50
makes sense to use this uh so let's get rid of this open dot form file
50:56
to to check skip zero time because what happens uh with the clip if
51:02
you go back to the first time step there is no such thing as cell types in
the first time step so it defaults
51:09
back to alpha water and then if you go it so it assumes alpha water
51:15
is selected and it's not correct so you have to every time select go one
51:21
time step further select cell types so it is a good idea to
51:26
skip zero time just for this purpose and then the first time step is 0.01 and
51:34
not zero anymore and now we have the correct visualization
51:40
okay and as you can see it oscillates from the left to the right and maybe
just to show you the the sync
51:48
i'm just going to load the sink itself
51:54
maybe i will even put in a plane as that normal plane
52:02
just to visualize the here and also here
52:08
okay and now i want to show you only the sink that's fine
52:13
use a color of black for the sink now we don't really see no here it's
52:21
i miss clicked here the color black and you can see that there is a very
52:26
thin line and i can increase the thickness to five and now you can see
52:32
that this is my sink this black line so here water is
52:38
swapping over the sink's edge and this is what i wanted to happen here
52:44
okay so we can now start and okay we don't care about this
52:52
yeah as i mentioned these interpolation errors are always coming with the
over set mesh so this is not something that
52:58
you can skip this is something you have to accept you can reduce it by
using a finer mesh but
53:03
then of course your simulation will be slower okay and now we touch the
surface
53:11
we are the the the water from this from the inlet is penetrating
53:17
the water and then it mixes the initial set of water
53:24
and then we are filling it up and the end this movement is much more
53:29
interesting than just a simple linear movement from the center to the
right
53:35
but good to know that you can leave the domain so you can just remove
the faucet from the
53:41
flow and now it's swapping over and then the water leaves
53:46
the domain and goes into nirvana
53:54
and now we are at 50.
54:00
yeah so let me just possibly go back here okay
54:06
so now cell types no here cells i want to watch no i want
54:13
to watch uh the cell types here yes okay so the
54:18
cell types and why was my initial block mesh this high and because the
initial block mesh then
54:25
defines the over set boundary and then the overset boundary then defines
this
54:30
cells with value one so the green cells i did start
54:38
initially with a smaller domain which ended here but then what happened
is that the
54:45
boundary condition that we utilize where is it
54:51
no here the zero gradient boundary condition then just uh numerically
54:58
just pulled down the flow and what you did not have is this uh
55:08
is this uh movement of the flow so this tilting of the flow
55:15
it was just a direct flow downwards because the boundary condition
numerically pulled down
55:21
the velocity so it it does make sense to add a little bit more into the
domain
55:27
but this really a little bit more into the overset mesh but this really
depends on the problem
55:34
on your problem okay so now we can just wait
55:40
and see so the simulation is now running on four
55:45
cores and yeah so this is what it looks like
55:52
so it is i really like this tutorial it it's not very scientific but it is a fun
55:58
tutorial but the idea behind this is that you understand how overset works
and how
56:05
how you have to set it up for your case because this case also works for
3d cases
56:10
there are overset tutorials which only use one block mesh dictionary and
it creates
56:16
two separate uh no not connect that blocks which then uh are being used
uh
56:24
we move but that is restricted by the fact that you only can only do this in
block mesh
56:30
but with this you can replace either the over set mesh or the background
mesh
56:35
or both with snappy hex mesh so so you don't have to use block mesh you
can just create
56:42
both the in both cases or just one of them a snappy hex mesh with smpx
mesh dict or
56:48
cf mesh and it's the same procedure so the same steps with the same
boundaries with the
56:53
same types just that you don't define your mesh with a block mesh but
rather with mesh ticked or with snappy hex mesh
56:59
dictionary and this also works then with a 3d mesh
57:06
with a 3d mesh you may encounter numeric problems but then you have
to
57:12
play around with your numeric settings as i mentioned here in every
solutions
57:19
okay so where are we we still have uh some times to go so maybe let's uh
57:26
recapture what we did here okay so let me just close here most of
57:33
the files here don't need don't need no let me just close everything
57:47
this i don't need this i i will leave that get rid of these and now we only
have
57:53
okay all clean scripts this really just sets back everything into the original
58:01
uh setup okay so what does this do first it
58:07
creates the overset mesh by going into overset and running a subscript
there and then it switches to the
58:13
background mesh set creates the background mesh merges it and then
starts the simulation
58:19
in parallel then this subscript all round.pre
58:25
creates just an open.form file which is deleted by the old clean script
58:31
then it creates the first block mesh which then defines the cell types as i
mentioned just before then we
58:37
define the hole inside of this uh side of the block mesh
58:43
then we get rid of the the box the hole inside of it so we just throw it away
58:49
with subset mesh and then we define the inlet
58:55
and the faucet boundary so the six inlet faces and the fourteen forces
faces
59:00
and then we create the patches out of those cell sets so inlet one and
then faucet and then
59:07
once we have the the over set mesh then we again in the second folder
we create a second
59:13
open.phone file we create the background mesh we merge the overset
mesh with the background
59:20
mesh and then we define two cell sets c0 and c1
59:25
just to reference the two the overset mesh under the background mesh
59:30
and and we also create a cell zone which will then which we will move and
the movement is
59:37
in dynamic mesh dict then we create a copy of the backup folder
59:42
then create we execute set fields which then uses those two cell sets
called
59:47
c0 and c1 to create the zone id so that the solver knows which one
59:52
is the background mesh and which one is the overset mesh and then we
can run the simulation
59:59
and as i mentioned i have no idea why
1:00:05
on the right hand side the cell types look so weird
1:00:12
come on why the cell types are distorted like this as i mentioned if you
reconstruct after
1:00:18
the simulation then this will all be fine and i don't understand why it's only
on the right hand side
1:00:26
why it's correct on the left hand side and why it's wrong on the right hand
side so this has something to do with para view
1:00:31
visualization and parallel i don't know just be aware that if you are
1:00:36
visualizing the decomposed bar results then you will see this the
simulation is
1:00:43
did run correctly is just a visualization issue
1:00:50
okay so and that was actually it what i wanted to show you
1:00:56
so it the simulation still runs here so as i mentioned i will put
1:01:04
the the link to my to my uh to this tutorial
1:01:11
on the wiki as well as the link to my github account so this into the
description box below
1:01:18
so you can either take a look at my uh short description here or the
1:01:26
end these uh three uh figures here or you can just directly go
1:01:32
and then download the zip file and so you can start with your simulation
immediately if you have not done so
1:01:39
already okay so i think
1:01:45
one last thing that i want to show you here is um okay let's just do two
things here
1:01:52
okay so alphavoter i want to visualize it between
1:01:57
no cell types but here between zero and one okay and now
1:02:04
you may already know this or not that you can add source and then
alphabetical and i
Additional post-processing (incl. video export)
1:02:11
never know this by heart and notate time is i will yes so
1:02:17
now you can visualize which time step you are on i really like personally
the
1:02:23
times font a bit smaller and i don't like the f
1:02:28
so this is f is how many uh zeros you have i really like to use two
1:02:37
um g if i'm not uh yes so 2g so with that we only have
1:02:44
the two uh numbers behind the comma and then i like to put in here an
1:02:50
s for seconds so we know that it is 0.59 seconds
1:02:55
and we can position it into the lower right corner and then let's see
1:03:02
how far we are here yeah we are almost finished
1:03:08
okay and then one last thing that i also have never mentioned is that you
1:03:13
can add for example a text okay so you can call it full set and
1:03:21
sync and let's use again the times and then you
1:03:28
can put it into the right of the top corner or you can move it
1:03:34
manually [Music] this should be i don't know 70 0.7
1:03:41
that's fine and 0.5 maybe a bit further up
1:03:46
false attention so there you can just write anything uh that you want and
now the simulation
1:03:53
should be at the end
1:03:58
yes it did finish good so now what i wanted to show you is how you
1:04:06
export a video so first you can create a screenshot yeah so let's just type
in pick
1:04:16
full hd resolution that's not full hd
1:04:24
that come on 20 yes so this is full hd
1:04:30
and now we have um where do i have it i saved it here okay
1:04:36
i saved it here um an overset tutor so now we have a screenshot
1:04:42
if you didn't know how to do that and we can also create a an animation
1:04:48
for that i will move out of here and just create video and now we could
1:04:57
use avi i personally really like pngs
1:05:04
and then full hd
1:05:16
oh no it crashed okay so that's not good what happened
1:05:25
so it did create the first couple of uh
1:05:32
first couple of pictures okay then sorry i will cut the video and come back
1:05:38
once i have the uh the the the
1:05:44
pictures here okay so now i restarted paraview and loaded everything
1:05:49
and i just exported the animation and now as you can see we have here
1:05:58
100 pictures i forgot to
1:06:04
enable or disable here skip zero time so this is why i have here the first uh
1:06:11
one so i just delete this and now what i personally really like to utilize is
ffmpeg
1:06:19
to bring these together why so ffmpeg you can install it you can
Using ffmpeg to create the video
1:06:25
google it how to install ffmpeg in ubuntu and then you can install it and
then we
1:06:31
can just create um the frame rate
1:06:36
so we wrote out 10 time steps no 100 time steps so for one second but
1:06:43
if i want to prolong it for 10 seconds then i want to have 10 images in one
second
1:06:49
so i want to have a frame rate of 10 but you can change this to 25 if you
want to have
1:06:55
frame rate of 25 and then the input it's the peaks
1:07:00
and so i'm calling it p or paraview called is pix and then four numbers but
the first number is always zero
1:07:07
and then it's percentage zero three because then we have three
1:07:12
numbers afterwards d dot png
1:07:18
and then the quality the video quality so just a rather high number here
and then the
1:07:24
output so faux set and sync dot mp4 for the tensing.mp4 this should
1:07:34
do it yeah and then we have here a faucet and
1:07:40
sync copy let's just put it here
1:07:46
and the windows media player doesn't really like this format by ffmpeg so
but vlc has no problem with it so now
1:07:54
you can run it
1:08:00
and as here you can see how the flow is going out of the sink on this side
1:08:06
it also goes a little bit out on the left-hand side but i really like how then
the
1:08:13
the faucet then pushes the at later stages the water to the side
1:08:18
because it's so much water here here and here again okay so that was it
The end
1:08:24
this is what i wanted to show you i hope that you liked this tutorial and
that you can utilize it for your problems
1:08:30
and uh please just download the zip file it is there on my github account
and give it a try
1:08:36
with that i would like to thank you for watching and listening and i hope to
see you next time

Dynamic Mesh OpenFOAM


Tutorial 3 - Finite Volume Solvers
hello everyone this is sebastiano stipa
0:03
and this is the third video tutorial
0:05
of the dynamic mesh series in open phone
0:09
in the first video we saw how to set up
0:11
and run
0:12
an advanced set the block mesh
0:16
then we saw how to use the interpolating
0:18
solid body
0:21
motion solver for moving the mesh around
0:24
the
0:25
pitching airfoil and in this video we
0:28
will see how to use the finished volume
0:30
motion solvers
0:33
the fit volume motion solvers
0:37
are different from the the
0:40
mesh motion solver we saw in the last
0:42
video because they solve
0:45
a motion equation in order to calculate
0:48
the point motion in the previous video
0:52
we basically did an interpolation of the
0:55
motion
0:56
of the body throughout the entire mesh
0:59
and in some sense
1:03
all the all the motion solvers defined
1:06
inside the src dynamic mesh
1:11
motion solvers do this they do not solve
1:14
an equation in order to calculate the
1:17
mesh motion
1:19
this kind of motion solvers
1:23
can be found inside the fv motion solver
1:26
directory
1:27
and basically there are displacement
1:30
motion solvers
1:31
and velocity motion solvers for the
1:34
velocity there is only
1:35
the laplacian motion solver
1:39
and for the displacement there is the
1:41
sbr stress and the laplacian motion
1:43
solver
1:44
the laplacian motion solver solves for
1:47
the laplace equation for the motion
1:49
displacement
1:52
for the point displacement while the sbr
1:56
stress
1:57
is uh more
2:00
let's say it's more reliable
2:04
since it uses a different approach
2:07
it solves still an equation
2:11
but is the solid body
2:14
rotation equation for the motion
2:17
displacement
2:18
for the motion displacement which comes
2:21
from
2:22
the constitutive law for the for the for
2:25
the materials
2:30
if we used only the constitutive law
2:34
of the materials the rotation the solid
2:37
body rotation
2:38
uh are not allowed so we have this term
2:42
which accounts for the solid body
2:45
rotation of the body you can find this
2:49
source code here
2:52
and basically this is the equation which
2:55
is being solved
2:56
by open form so you'll have these
3:00
two extra terms with respect to the
3:02
laplace equation
3:04
which is only this one which is this
3:06
term
3:08
and this is the solid body rotation term
3:12
due to dwight in 2004
3:16
so you have also
3:19
uh for the laplacian solver
3:23
the component where you can
3:26
if you want to to restrict the motion uh
3:29
to one direction
3:30
you can use the component displacement
3:32
but the working principle
3:34
is really the same with respect to the
3:37
full displacement
3:38
or full velocity uh motion solver
3:43
okay let's go uh to the to the
3:45
contradict
3:47
of the case the case is the same with
3:49
respect to the to the last tutorial
3:53
the only thing that changed
3:56
is the fact that we have to add a new
3:59
field
4:01
which must be solved for which is the
4:03
point displacement
4:06
and you can find it in the in the
4:08
initial condition
4:09
and boundary condition directory the
4:11
zero the zero directory
4:14
so here you will see that there is this
4:16
new field
4:18
and you have to provide boundary
4:20
condition and initial condition for it
4:22
so the initial condition is zero
4:25
everywhere
4:26
and you see that the
4:31
the motion of the body does not enter
4:34
anymore the problem inside the dynamic
4:37
meshdict
4:38
which is where it is not specified but
4:42
it enters instead through the boundary
4:44
condition for
4:45
the point displacement here we specify
4:48
the motion
4:49
of the airfoil which is a type angular
4:51
oscillation
4:52
oscillating displacement we specify the
4:55
axis the origin
4:56
which is zero so we are uh making the
5:00
air fall
5:00
oscillate with respect to the leading
5:03
edge
5:04
the angle zero which is a useful
5:06
property
5:07
if you want to start
5:10
uh if if the
5:13
if the starting configuration is not the
5:16
zero amplitude configuration
5:18
like if you want to do a pitch only in
5:21
the in the
5:23
let's say in the negative
5:26
in the negative uh for the negative
5:28
angles you have to start
5:30
not from zero but from three point
5:34
one four which is pi so you will head
5:38
you know sorry you have to put
5:42
7.5 which is the half of the of the
5:45
amplitude of the oscillation
5:48
and then the airfoil will not oscillate
5:51
around the
5:53
initial condition but will perform
5:56
an oscillation around 7.5
6:01
degree pitch then you have to
6:05
specify the amplitude of the oscillation
6:07
in radians
6:08
so here i use the calc
6:12
option then you have to specify
6:17
the omega the
6:20
angular the angular velocity the
6:23
position of the of the oscillation in
6:26
radian per seconds here is 6.28 which is
6:30
the same of the last video
6:32
meaning that the airfoil is performing a
6:35
complete oscillation in one second
6:37
and then you have to specify the initial
6:40
value
6:41
for the motion at this boundary then you
6:44
have the same empty for the front and
6:46
back
6:47
patches and then for the rest of the
6:50
patches
6:50
which are accessed with the wild car
6:54
which is the the star symbol you have
6:57
fixed value
6:58
because the inlet patch and the outlet
7:01
patch are not moving they are fixed
7:04
um okay so this is the the point
7:06
displacement
7:07
uh file then you have the dynamic mesh
7:11
dict
7:12
which until here is the same with
7:14
respect to the
7:16
to the last video but this time we
7:19
change the solver which is this
7:21
displacement sbr stress
7:23
and we choose a diffusivity which is
7:27
this parameter here gamma the different
7:31
methods
7:32
for choosing the diffusivity
7:35
we will see the implication of the most
7:39
important one
7:42
during this tutorial so for now we use
7:45
an
7:45
inverse distance which means that the
7:47
diffusivity is calculated
7:53
let's say the distance from the moving
7:55
patch is calculated
7:57
off or from the patch which is specified
7:59
here is calculated
8:01
and then diffusivity is uh
8:05
um is the reciprocal is inversely
8:08
proportional to this
8:09
to this distance
8:12
okay so the last thing that we have to
8:15
set
8:16
is sorry i open this
8:20
the last thing that we have to set is
8:24
the way we want to solve
8:27
the the for the point displacement
8:32
here in the fb solution we have to
8:34
specify it
8:36
so the field cell displacement
8:40
must be must be present
8:44
in the in the solver subdictionary and
8:47
we have to specify
8:49
the solver which we are using to solve
8:51
for the point displacement
8:53
this motor the tolerance and and the
8:56
relative tolerance
8:58
so i use the geometric algebraic multi
9:01
grid here
9:02
because because it's very good for for
9:05
let's say
9:06
laptops because it's very fast if
9:10
not massively parallelized
9:13
and i use the gauss-seidel as a smoother
9:17
okay so we are ready to start the
9:19
simulation the rest of the case is
9:23
the same with respect to the last video
9:26
you will find this
9:27
this case a link for this case into the
9:30
comments
9:31
of this video and
9:34
yes uh here you can see that there is an
9:38
all run uh bash script
9:41
that you can launch in all the in order
9:44
to run
9:44
all the case uh at one shot but
9:48
here in this video we will go step by
9:50
step so
9:51
let's enter the directory
10:03
okay let's load the open form 8
10:05
environment variables
10:08
let's launch
10:12
the block mesh
10:17
then the extrude mesh
10:21
then we decompose the case but
10:25
before decomposing the case we have to
10:30
copy the zero point orange
10:34
renaming it zero directory because open
10:38
form only reads
10:39
zero uh for open form if
10:43
this is called zero point orange it
10:45
doesn't exist
10:46
basically so now we can decompose the
10:49
case
10:54
and then we'll start the
10:57
simulation so
11:05
we go for mpi
11:08
run np4
11:12
pimple form parallel
11:19
okay now i stopped this case because i
11:22
already solved it
11:26
um
11:28
okay let me stop it from the background
11:32
processes
11:41
okay so after the case
11:44
has finished we have to reconstruct the
11:47
case
11:48
with reconstruct bar
11:52
and then if we want or
11:55
we can load the the paraview
12:00
we can load paraview with paraphone
12:05
or we can transform in btk
12:08
typing form to vtk
12:12
and then a vtk folder will be created
12:18
just like this one and then we can
12:21
just run paraview
12:24
and read from that folder
12:28
so
12:35
which is this one now okay it is this
12:38
one
12:43
okay so
12:52
okay this is the
12:56
solid body rotation rotating
12:59
motion solver
13:02
you can see that here there is this
13:05
subtle problem
13:08
which is that the inverse distance
13:13
gives problem when computing the
13:16
distance
13:17
let's say the diffusivity of this point
13:20
because
13:21
it is not as much
13:24
as mute
13:28
zone of the of the profile so the
13:31
diffusivity in this point
13:33
is not well calculated how can we solve
13:35
this problem
13:37
because if we had
13:40
a finer mesh this for sure
13:45
would give us errors so we have to
13:49
adjust this problem the problem on
13:52
of having this bad deformation here
13:56
in this regard the solver that i
13:58
explained in the in my last tutorial
14:00
is better from this point of view
14:03
because you can fix a zone around the
14:06
profile
14:08
where the points are moving rigidly
14:12
but when we use finite volume motion
14:15
solver
14:16
we have the possibility to use
14:19
manipulators
14:22
and we have also the possibility to
14:23
change the
14:25
computation of the diffusivity for
14:27
instance
14:29
this is a trick that i always use
14:34
it is called the banana trick you put
14:37
here
14:41
casually the word
14:45
like banana and then launch
14:49
open phone and open phone will say
14:53
i i didn't find this kind of diffusivity
14:56
the um the possible diffusivity
15:00
the possible diffusivities are these
15:02
ones
15:03
so the diffusivity
15:06
that is more robust of course
15:09
is the inverse distance but in this case
15:13
for the air fall we could use the
15:15
inverse point
15:16
distance which computes the diffusivity
15:20
based upon point distance and not
15:23
patch distance or we can also use the
15:27
inverse volume which is not bad
15:30
and talking about
15:34
manipulators the manipulators are the
15:37
exponential manipulator and the
15:40
quadratic manipulators so now we are
15:43
going to
15:43
try the inverse point distance
15:49
and the quadratic manipulator in order
15:51
to use the manipulator
15:53
you have to specify
15:57
a method of
16:00
calculation for the diffusivity and then
16:03
put
16:04
the manipulator in front of it
16:07
just like this one
16:11
so you specify the inverse point
16:13
distance with respect to the airfoil
16:16
and then put the manipulator in front
16:19
of the of this
16:22
of this of these two words
16:26
so the manipulator will take the
16:29
computed diffusivity field
16:31
and manipulate
16:34
it in some way for example
16:38
[Music]
16:40
let's let's open the
16:43
exponential manipulator
16:55
okay so uh it returns
16:58
the exponential of minus alpha divided
17:02
for d where d is the diffusivity
17:05
alpha must be specified after
17:09
the exponential world just like this
17:12
exponential 30 inverse point distance
17:15
airfoil
17:16
instead the quadratic
17:19
doesn't need a number after it so
17:25
this returns the square of the given
17:27
diffusivity
17:28
so it doesn't need any any any number
17:31
any additional number
17:33
so let's see uh with this
17:36
kind of diffusivity quadratic inverse
17:39
point distance
18:06
here i have already sold the case
18:10
so i'll open it in part view
18:28
so this seems a lot better
18:32
as you can see the point
18:36
is correctly moved the point at the
18:39
trailing edge
18:42
so with this kind
18:45
of mesh motion solver you have to really
18:48
tune
18:48
the parameters of the mesh motion
18:52
every problem has e-zone parameters and
18:56
you have to
18:56
make a lot of uh attempts
19:00
before before uh obtaining a
19:04
good mesh resolution throughout the
19:06
iteration
19:08
but uh with with some effort it's
19:11
possible to do it
19:13
okay so now let's see uh
19:16
very quickly uh how the laplacian
19:21
finite volume motion solver works
19:24
the case is basically the same
19:27
with respect to displacement sbr stress
19:31
the only thing that changed
19:35
is the presence is is the difference
19:38
it's a different solver so
19:42
this one
19:47
you have to put displacement laplacian
19:51
instead of displacement sbr stress
19:55
for the rest is the same so here
19:59
just to just to compare i used
20:02
the same diffusivity with respect to the
20:07
to the latest simulation i i showed you
20:11
in order to uh show you the differences
20:14
between the
20:15
laplacian and the sbr stress equation
20:18
so let's reopen peter view
20:41
as you can see here the presence
20:44
of this bad quality cells
20:50
is not eliminated so
20:54
for me the sbr the spl stress
20:58
is better for this application but it
21:02
could happen
21:02
that the laplacian is better for other
21:05
applications
21:08
it's true that in this case the the this
21:11
setup
21:15
this setup is the best
21:25
in this case this setup is the best
21:28
because
21:29
it gives a high quality mesh throughout
21:32
all the iterations so in the in the next
21:35
video
21:36
i will show you uh how to uh
21:39
run uh
21:42
how to use the the solid body rotation
21:46
with the arbitrary mesh interface
21:51
which is this one
21:59
and if you have particular requests
22:03
for different motion solvers please
22:06
ask in the comments
22:11
so this is another approach uh another
22:15
more approach
22:16
uh which instead of deforming the mesh
22:19
or
22:19
with an equation or instead of deforming
22:22
the the mesh
22:23
with an interpolation of the
22:26
motion of the body throughout the whole
22:28
mesh is directly splitting the mesh
22:31
into a region which is fixed in a region
22:34
which is
22:34
rigidly moving
22:40
so thank you for thank you for the
22:43
get the attention and see you in the
22:46
next video
DynamicMesh OpenFOAM
Tutorial 2 -
InterpolatingSolidBody
okay hello everyone i am sebastiano and in this video we will see how to
0:06
set up the remaining part of the case which i showed in the last video in
0:13
particular i show how to use in an advanced manner
0:18
the block mesh utility in order to make a mesh around naka0012 airfoil
0:25
and in this tutorial we will see how to set up the remaining part of the
case and in particular how to set up the
0:31
dynamic mesh dict which is locating which is located in the constant
directory
0:37
in order to periodically pitch the airfoil around some points which
0:45
we will define with an amplitude of 15 degrees
0:51
so let's talk about the interpolated solid body
0:56
motion solver for a few seconds this is a different solver with respect
1:03
to others because it doesn't employ an equation which it which is solved
by open form
1:13
as the displacement sbr stress which we will see in the next video or the
displacement laplacian
1:19
which is very similar rather it uses an interpolation or let's say a scaling
1:26
of the motion of the boundary throughout the whole mesh so basically
InterpolatingSolidBody
1:34
three regions are defined and a scaling and a scaling factor is
1:40
defined uh depending on what regions we are in so then the
1:48
motion of the body is multiplied by this this scaling the scaling factor
1:55
and applied to the self motion so in the in the outer part this the scaling is
0
2:04
so the mesh is not moving in the in the central part between
2:11
between these two circles which are defined with two parameters which
are the outer
2:18
and the inner which are this ones in this region the scaling goes from
2:25
zero to one so on this edge the mesh is not moving
2:31
and on this edge the mesh has the same motion of the airfoil inside this
2:39
inner circle the mesh is rigidly moving as the airfoil so this is very good
2:46
because if you have boundary layer cells or do you want to preserve the
mesh near the airfoil
2:54
this method the interpolated solid body will preserve the mesh around
your body so you
3:01
might want to choose this because of this feature and also it allows for
very large motion
Source Code
3:09
if compared with other motion solvers so let's have a look at the source
code
3:16
inside the open form 8 slc dynamic mesh
3:24
motion solvers displacement interpolation no solid body
3:31
interpolation interpolating solid body motion solver
3:38
the point c file where all the functions are defined so this is the
constructor
3:44
of the of the class of the interpolating solid body motion solver class
3:50
and by the way here we can see what parameters uh have to be have to
be set
3:57
in the in the dynamic mesh dict which is the file where this function is
going to read
4:05
the parameters so we have the patches which are the
4:11
patches which are moving basically then we have the center of gravity
4:18
which is a new refinement a new reference point around which
4:25
the motion is calculated so the motion this is very important because this
is
4:31
somehow misleading i think because the motion is not calculated
departing from the
4:37
origin of your reference system but it but it is calculated the parting of this
point so if you want to calculate
4:45
the motion departing from the origin you have to set this to 0 0 0 then you
have the di
4:53
which we talked about before which is the inner distance
4:59
parameter in the dynamic mesh dict which is the radius of this circle so
5:07
within this radius from the patch the mesh is rigidly moving
5:13
then you have the outer distance which is the other which is the other
radius the radius of the of the biggest
5:20
of the biggest circle and then you have other parameters which
5:27
are the parameters related to the solid body motion function
5:33
which you can find it here we will use these are all the possible
5:41
solid body motion functions we will use the oscillating rotating motion in
order to pitch the
5:47
airfoil and you can see which are the parameters which are needed in the
block mesh dict so here the
5:55
constructor [Music] uses this function read
6:01
which you can find it here and you will have three parameters which are
read from a dictionary called
6:10
solid body motion function coivs and this is substituted by the type name
6:16
which is uh in the point h file
6:21
which is this one so you'll have a subdictionary which is called oscillating
rotating
6:29
motion curves where you will find
6:34
those three parameters basically origin which is the origin
6:41
the point where the oscillation is centered departing from
6:48
the center of gravity defined in the interpolating solid body
6:55
you have the amplitude which is a vector because you could define an
oscillation in the
7:02
three direction here we will define an oscillation in the y direction so we
have 0 15 0
7:09
and this value is given in degrees because here it converts the rotational
7:16
motion from deck to red then we will
7:24
have to set the omega which is the angular frequency of the of the
7:30
uh oscillation in this video we will set an omega
7:38
to 6.14 radians per seconds which is 60 which is 60
7:47
rpm it means that we do an oscillation a complete
7:52
oscillation every one second so let's have a look at the
8:00
dynamic mesh dict
8:06
which is located in constant and here it is we have
8:13
the library which stores all the dynamic motion solvers fv mesh
8:21
then we have to load the library which uh contains all the motion solvers
8:29
basically then we have to choose the solver which in our case
8:34
is the interpolating solid body uh sorry for a misleading in the slides
8:41
here is interpolating a solid body because it is basically an interpolation
8:48
all over the mesh of the motion of the solid body then we have to select
the solid body
8:56
motion function which is we said angular oscillating sorry oscillating
rotating motion
9:02
and then we have to select the parameters of the interpolating solid body
class
9:10
and then the parameter of the oscillating rotating motion motion function
which is
9:17
the solid body motion function class so reset the patch
9:24
airfoil which is the patch which is moving uh if you remember in the last
video we
9:30
will define the the the name of the of the
9:35
patch uh was it was airfoil so we select the patch uh one of the
9:42
boundaries let's say if you go in the into the zero for example u we have
the
9:49
airfoil so you have not to define cell zone or face zone here the the mesh
motion
9:58
solver works with patches so you have to select the patches then you
have to select the
10:06
center of gravity so i selected 0.5 which is
10:13
a reference for the mass motion which is located at the center of the
airfoil which is
10:20
not yes which is here 0.5 then i i set an underneath an inner
10:28
distance of 0.01 meters which means that i'm putting this circle
10:36
very close to the airfoil
10:42
then i set the outer distance to 4.0 meters which means that i'm
10:50
putting this very far and i think this is the best
10:55
solution because it spreads the mesh motion throughout the whole
11:02
possible mesh but you could also lower
11:07
the radius of the outer distance but you'll have more deformation because
11:16
a smaller area will will be subjected
11:24
to all the deformation and the coefficient will pass from one to zero very
sharply
11:31
so uh this is not a very good idea then we have the coefficients of the
11:37
oscillating rotating motion which are origin 0.5 so here basically
11:43
i'm saying that the airfoil is oscillating with respect to the trailing
11:50
edge because the the charge is one here and i i moved 0.5
11:57
in the x direction and then another 0.5 in the x direction so if i want to
make
12:04
the airfoil oscillate with respect to the to the leading edge i have to put 0
12:10
here and 0 here if i want to make the airfoil oscillate with respect to the
center i
12:17
have to make i have to put 0 here and then 0.5 here then we have the
amplitude that
12:24
as i said is in degrees and is a vector and then i have the omega which is
in
12:30
radians per seconds which is 6.28 which is 2 pi
12:37
okay so the dynamic mesh dict is done now i will launch the simulation
Extrude Mesh
12:44
i will repeat the passages of the last tutorial by the way i forgot
12:52
to explain the extrude mesh which is useful not in this case
12:59
but in cases where you let's say you create a background mesh
13:05
with a block mesh with one cell in the infinite direction
13:11
then you refine the mesh with the snap px mesh for example because you
have to mesh to refine the
13:19
mesh around the body that you want to put in your background mesh
13:24
and the refinement is an epx mesh works three-dimensional so you
cannot
13:31
choose to refine only in some direction so snappy x mesh will split the
cells in
13:38
the y direction into more cells and you will have more than one cell
13:43
in the y direction which is a thing that you don't want so basically you use
the
13:51
extrude mesh you take the surface mesh onto a patch
13:58
which is let's say a strictly 2d mesh which is this one but you have to
14:03
think about this as a 2d mesh a face mesh not a cell mesh
14:10
and then you extrude the face mesh in the in the infinite direction here
14:16
would be the y direction for a certain distance so
Extrude Mesh Example
14:22
you can see that here the mesh was
14:29
already done with one cell in the y direction
14:37
it was already done with one cell in the y direction so there is no need in
reality to use the
14:45
extrude mesh dit but what happens if i
14:51
if i put more than one cell in this direction for example
15:00
let's let's do this very very briefly
15:06
when i define the blocks here i have to put two
15:13
this is not parameterized because it wasn't the purpose
15:20
of this tutorial but let's do it for clarity okay
15:30
let's do the block mesh and then perform again so
15:40
let's click apply and we will see that the mesh has now two cells
15:48
in the y direction this is not good so i want to use the extrude mesh to
extrude
15:56
the 2d the infinite direction phase the phase normal to the the
16:03
the boundary normal to the infinite direction i want to extrude this
boundary along
16:09
the infinite direction which is y here the y direction which you can see
here
16:18
and i want to have only one cell in this direction so i launch
16:26
the extrude mesh
16:34
and then let's see what happened
16:43
now okay now the mesh has only one cell so this is the purpose
16:51
of the extrude mesh but for this tutorial it wasn't necessary let's say
because we only used
16:58
the block mesh in which you can choose perfectly the the number of cells
in the infinite
17:04
direction so now let's run the case so that
Running the Case
17:12
we will we will talk about the case while the case is running
17:17
so i decompose the case in four
17:24
sub i i decompose the case in four and open phone will create four
17:30
directories uh which are called processor one two three and uh and zero
because open form always
17:38
start from zero uh in this way the domain is split
17:44
in four parts and every processor of my computer
17:49
does the computation on one of these parts so the the time required to
compute
17:57
this case is lower very much let's say that open form doesn't have a
18:03
very good scalability because it happened
18:09
to me to try out perform with very much course up to 700
18:15
and the scaling efficiency was not very good but with lap upon laptops
18:23
upon personal computers let's say that it is good so now let's run the
pimple form
18:30
which is the application that we are using since we decompose the case
we cannot
18:36
just type pimple form but we have to use
18:42
the uh sorry we have to use the mpi library in order to
18:50
launch the application so we type mp1 we specify the number of
processors
18:58
pimple form and then set the parallel
19:08
options okay this is there is an error
19:16
[Music] ah because i didn't load
19:22
open form eight no
19:30
okay i have to re decompose the case again because i was running with
open form six
19:37
which i use to open paraview which doesn't have this
19:44
interpolating solid body motion function by the way i just have to copy the
0
19:50
directory because uh in this way i have an untouched
19:57
directory which is this one if open phone for some reason puts data here i
can delete it
20:05
so now i already compose the case
20:12
okay and rerun the pimple form okay it started perfectly
Boundary Conditions
20:22
now let's have a look at the case so let's firstly have a look at the
boundary conditions
20:29
we have first of all we have
20:36
the domain was this one we have the inlet which is the blue the outlet
which is the green and then
20:43
we have the airfoil and now we have the back in front which has which are
the two
20:48
infinite patches where an empty boundary condition
20:53
is always used we have the ear foil which is a zero gradient
20:59
as normal because we pressure we we always put a zero gradient onto
the
21:04
walls then we have the inlet which is zero gradient as well
21:10
and then we specify the pressure at the outlet which is uh how cases
21:17
are set up in incompressible flow if we have compressible flow we have uh
21:25
very big problems on the boundary conditions but in general we have to
specify the
21:31
variable at the inlet because if the flow is supersonic for example
21:37
the the pressure at the outlet the information of the pressure which is
adapted doesn't
21:44
propagate throughout the domain because the information travels at the
sound speed
21:50
and if we are supersonic we go faster than sound speed
21:55
okay then let's have a look at the you
22:02
okay here i use as i explained in my last video
22:09
an approach which i like very much that consists in having a
22:16
file where i put all my parameters and then based on these parameters
22:23
i calculate the more difficult parameter let's say
22:29
so here for example that was used for a compressible case
22:34
thermodynamics variables it doesn't make do not make much sense for
22:41
incompressible cases but i here i set the mach number for example
22:47
and this expression basically returns me velocity in x and z direction
22:55
which i put in the internal field for the initial initial condition and at the
inlet so
23:03
i use in order to do this we have to write the calc and then
23:11
between i don't know how these are called in
23:16
english but between this one we have to write basically expressions
23:21
we have to put the dollar symbol in front of each variables
23:27
which is called from the initial condition file and we can use pre-specified
functions
23:33
such as cosine sine deck to rod
23:39
or the square root so this is basically
23:44
a way of setting up the difficult part once for all and then just set up the
23:53
the easy part the easy numbers so on the airfoil we have this is very
23:59
important we have moving wall velocity which is
24:05
not a fixed value because therefore in this case is moving so we cannot fix
a velocity value but we have
24:12
to use this boundary condition which basically make sure that the relative
velocity
24:19
between flow and airfoil is zero at the airfoil so this is the condition
24:26
that must be used if a boundary is moving we can use this boundary
condition also
24:33
for other application but maybe we will talk about this in another video
tutorial
24:40
for example in racing car application this is used for the ground
24:46
then we have at the inlet a fixed value which specifies the velocity
basically
24:54
at the outlet we have an inlet outlet which is a robin boundary condition
25:00
which is a zero gradient if the flow is going from inside the domain
25:07
to outside the domain and specified specifies an inlet value if there is
25:13
recirculation throughout the boundary so in this case the inlet value is
25:19
zero then this is the back and front which is
25:25
which are always empty then we have let's see
25:32
1.18 i cannot catch this
25:38
so then we have um the new t
25:46
which is the turbulent viscosity which is for the outlet and inlet is
calculated
25:53
departing from k and omega and at the airfoil
25:58
i specify that i want to use the wall functions
26:04
in order to use the for the wall function we have to ensure that the y plus
at the first
26:11
cell centroid is comprised between 30 and 100 or something more
26:18
depending on the reynolds number for higher angles we can arrive to 300
for low reynolds we are
26:27
let's say limited to 60 between 30 and 60 but in general
26:34
yeah a value between 30 and 100 is correct unless we have very bad
result
26:42
for the drag coefficient and also the lift coefficient but this affects
26:48
very much the drug coefficient and then if we want
26:54
to specify a value which is 0 if we would do the calculation and not use
the
27:01
world function we would use in open form a the note
27:06
nu t low ray wall function which basically just compute the y plus
27:14
but lets the user specify the value then we have
Omega
27:22
the omega which is also in this case calculated upon
27:29
a variable which are defined in the initial condition we have the wilcox
boundary condition
27:36
for omega wall which you can find on the internet this is the
27:42
height of the first cell squared and divided by four because it
27:49
would be the half eighth of the first cell squared which is calculated based
on the
27:56
grading if you want i can give you the expression not in this video and
then meowval which is the
28:05
dynamic viscosity density in order to calculate the kinematic
28:10
viscosity and this is a constant called beta which
28:15
is in general 0.075 then we have another value for the omega at the inlet
28:22
which also this one you can find on the internet there are very much
values in general
28:29
if you want to obtain good results for example for the force coefficient
28:34
you have to tune this parameter a little bit and also
28:40
the k at the inlet must be tuned a little bit but this goes out of the purpose
of this video
28:47
then we put the omega wall function
28:55
which is a intelligent wall function in open form which calculates the value
based on the y plus
29:02
then we have inlet outlet at the inlet and inlet outlet at the outlet so it is
basically
29:08
the same boundary condition then this the the
29:16
the same empty for back up front for the k we was we were saying this is
29:26
inlet outlet for inlet and outlet this is wrong because i'm using a low
29:32
ray but we should put instead
29:39
kq air wall function kqr what function uh let me check
29:47
kqr wall function yes let's directly copy this
29:56
this is if we put nuty low reward function this was correct but
30:02
in this case this one is good now we run the simulation with the bad k
30:08
boundary condition but it doesn't matter for the purpose of the video so
now the simulation has finished you see
30:16
here let's talk about about the solver a little bit the numerical solver
30:25
here i'm doing five pimple iteration
30:32
and two correctors for the pressure and the zero non-orthogonal
correction
30:39
corrections that it means that the pressure is solved solve it once for each
corrector loop
30:47
and yeah that's it one important thing that regards the
30:54
fb solution where you can set all this parameter
Numerical solver
31:01
is that yeah you have to set the solvers for the variables for the pimple
you have to specify the
31:08
final iteration because the uh in the final iteration uh
31:16
basically is this one is this iteration here
31:21
the last one um yeah here you you have to specify the
31:27
solvers for this for the final iteration here i put the same and this peak
core
31:34
for which with this point star which is a wild car which means p core
31:40
and peak or final both are sold with this parameter this is required if i
select
31:48
the correct fee option so this correct fee makes sure that the
31:57
mesh continuity equation is satisfied that means that when you move a
mesh
32:04
even if you have let's say let's imagine that you have zero
32:09
velocity throughout the domain and a static mesh the flux
32:14
and the velocity flux in each cell is zero but
32:21
if you deform the cells still with zero velocity you have a net flux into the
cells
32:29
which is not correct because the
32:34
cell the mean cell value must remain constant so basically this correction
32:43
adjust the flux in order to be zero even if the mesh is deforming
32:53
this is called i think the a-l-e
32:58
method lia method which basically consists in ensuring
33:05
the respect of a mesh continuity equation then there is the n outer
characters
33:12
which are the pimple loop and correctors you can also
33:19
set the momentum predictor to yes which means that open form will try a
33:25
solution for the continuity for the momentum equation at the start
33:30
of the of the time step and then the n non-orthogonal correctors which
33:35
is zero here because the mesh doesn't have a high level of non-
orthogonality
33:42
then another important thing when running with the pimple loop is that
you have to with the pimple you
33:49
can use a relaxation factors which are applied
33:54
between each pimple iteration here on the variable and here on the
34:00
equations but you have to make sure that on the final
34:06
pinpo iteration you are time consistent so you have to make sure that you
34:12
advance with the same amount for each variables and for each equation
34:20
so you have to set the p final and the other field final to one
34:28
in order to be time consistent if you do not put one here you are wrong
with the solution of the
34:34
equation then uh yeah let's let's have a
34:41
a very fast look at the control if f scheme is very normal you can find this
Control
34:47
on the tutorials on the open form tutorials i didn't put any strange thing
34:56
and you have the control dict where you have here i parameterize
something
35:03
i have the end time which is parameterized the right interval which is
35:09
parameterized i write every 0.01 seconds the time which is i think okay for
this
35:17
simulation uh i run with an adjustable time step
35:25
and a fixed uh quran freedix lewis number of 0.9 with the pimple
35:32
you can also go above one with this but in that case you have to increase
35:39
the number of pimple iteration and in order to save some time put a
35:46
tolerance that exit the pimple loop if the if the tolerance is rich
35:54
then you have the functions here uh which are for calculating oh this one
36:01
is is not meaningful here in fact open form should have give a warning
yeah here it
36:08
is he doesn't find anything of thermophysical properties because this
36:14
is an incompressible simulation so this is simply ignored
36:19
by open phone then we have the residuals the y plus calculator the forces
and
36:25
force coefficients for the airfoil so let's have a look at the residuals
Residuals
36:31
you can monitor the residuals of the simulation if you go
36:48
okay so let's have a look i think on a second not the case open phone
created the post processing
36:55
folder where the function outputs are stored so we go into the post
processing
37:02
residuals zero then we use the
37:10
four we have it in of6 form monitor minus l which plots
37:18
logarithmic in the y-axis residuals
37:26
and gnu plot should have plot yeah these are the residuals so the
pressure residuals is very high
37:34
because i have very bad mesh so in order to lower this one you should
37:40
increase the the mesh quality or maybe another approach is to
37:48
which i tried in another simulation i leave this here is to
37:58
use a higher number of of
38:05
pimple loops which are 20 and then set as i said before a residual control
38:12
on the pimple loop which exit is exits if a tolerance is reached so in this
case
38:21
you will have a better convergence of the pressure but not that
38:28
much because the mesh is the same so let's see
38:43
this is with the pimple acceleration let's call it uh and this is without the
38:49
pimple uh acceleration for the convergence
38:54
so now that we've seen this one we can go to see the
39:01
results of this simulation okay now that we have the simulation
39:10
finished we can see that into the processor there
39:16
are there are the time steps which must be reconstructed because here
there is
39:22
there are data related only to the portion of the domain
39:27
which processor zero is solving so this is not the total result is a partial
result and we have to
39:33
reconstruct the result from all the processors in order to do this
39:39
we use the reconstruct bar command which will take a while this is a very
Form to VTK
39:48
light simulation so this is very fast but usually takes a very long time for
bigger simulations
39:57
then we have to use we have two options here we have
40:03
reconstructed all the cases you see that folders are created outside
40:09
the processor directories but i don't like this mess in the case so instead
of using paraform
40:18
i'm using form to vtk which creates the vtk
40:26
files to be opened in paraview so this is as fast as
40:34
reconstruct power and after this we can delete
40:42
all the folders here
40:50
leaving the 0.00 folder
40:55
and also the processors okay now i open
41:04
paraview i load the btk
41:19
let's put a nice representation
41:32
orientation back okay okay now we should see the mesh moving
41:43
okay the mesh is nicely moving
41:48
and now we will play a little bit with the parameters
41:54
in order to
42:03
in order to see how they how they act
42:10
on the mesh motion
42:16
this is the result
42:32
okay let's change a little bit the parameters
Example
42:40
for example we could want to
42:46
here we have we had this dynamic mesh licked let's take a
42:55
solvent case where i put and this is this one the same
43:00
but for example let's take this one where i put the different parameters
43:07
so here i put the c center of gravity which is zero so my reference of the
mesh motion
43:15
is in the same place of the reference of my coordinate systems so
43:23
then i i i have a bigger inner distance
43:29
and so the mesh motion will be
43:37
will be accounted for by
43:43
by a minor number of cells and this will provide a more distortive
43:51
mesh a more a mesh with with less quality
43:57
during the motion because we are making a few points account for all the
mesh
44:04
motion then i put
44:09
the oscillation at the mid at the mid short so now the airfoil
44:17
is oscillating at the mid short the same amplitude and omega so let's
44:23
let's have a look at the part of you it would be nice to open them together
44:30
so we open
44:36
the previous case
44:49
and then and then we open
44:57
the other case
45:16
which is already solved obviously um
45:21
yeah let's put the black orientation axis
45:27
and edges 2d okay so
45:35
here it is now we have the two cases one
45:44
next to each other so let's see what happens let's compare the
45:51
mesh motions you can see that here the mesh is rigid
45:58
for a very long distance from the airfoil and then
46:04
all the motion happens in the last part of the mesh from here to here
46:13
here the mesh is more nicely deforming
46:21
and you can see this looking at the wake of the airfoil
46:30
here we have a very sharp deformation whereas in this case the
deformation
46:35
area is more smooth and very nice with respect to this one so
46:43
this is how you can change some parameters in order to have a better
mesh quality
46:50
obviously because this must be the objective when you when you move a
mesh you
46:56
have to be sure to have in every at every at every iteration
47:03
a high quality mesh in order to have always a good cfd solution
47:10
so for this tutorial i think there is no more to say
47:17
i will upload the case i will put a link of the case into the
47:25
comment of the on the video yeah please subscribe to the channel and
47:31
stay tuned for more dynamic mesh videos bye bye

OpenFOAM 3D Wing Tutorial:


pimpleFoam, AMI, and Advanced
Post-Processing
hello everyone today i'm going to show
1:14
you a simulation i ran
1:15
to create coefficient of drag and lift
1:17
plots
1:18
with changing angles of attack for this
1:21
simulation
1:22
i decided to use snappy hacksmesh which
1:24
ended up producing a mesh with around
1:26
1.4 million cells
1:28
and 10 inflation layers the solver i
1:30
chose was pimple foam
1:31
with dynamic mesh also known as ami
1:35
this stands for arbitrary mesh interface
1:38
and i ran this simulation on
1:39
six cores this simulation was performed
1:42
at a reynolds number of 1 million
1:44
and the total computation time was
1:45
around 25 hours
1:47
post processing was done using a mixture
1:49
of pair view and excel
1:51
these are the basic simulation
1:53
procedures and commands i used i am not
1:55
running through them
1:56
step by step because these are similar
1:58
enough to tutorials i have done
2:00
in the past and besides specifying
2:02
different boundaries and boundary
2:03
conditions
2:04
they are identical to those found for
2:06
the rotating fan
2:07
in room tutorial the main area of focus
2:09
for this video will be the
2:10
post-processing of the results in pair
2:12
view
2:13
to get the lift and drag values the
Angle of Attack
2:15
basic idea with this simulation was to
2:17
get lift and drag data for the wing
2:19
over a range of angles of attack this
2:21
could be done in two ways
2:22
running many steady state simulations
2:25
one for each angle of attack
2:27
or you could do what i have done here
2:28
i've specified an angular velocity
2:30
omega that the airfoil will rotate at
2:33
during the simulation
2:35
because we know the angular velocity and
2:37
time we can calculate the angle of
2:39
attack assuming the effects from
2:40
rotating the airfoil
2:42
are relatively small we can determine
2:44
the relationship between the forces
2:45
on the airfoil and the angle of attack
2:48
with two simulation
2:49
as we will see in the results this
2:51
approach does give decent results
2:53
but artifacts from the angular velocity
2:55
are noticed these artifacts would likely
2:57
diminish
2:58
as the angular velocity was reduced
3:00
however to achieve a
3:01
similar range of angles of attack
3:03
simulation time
3:04
would drastically increase now i will
3:07
show you the boundaries
3:08
i have specified for the simulation the
3:10
first one is the rotating region or
3:13
ami then the wing as a no-slip wall
3:17
a turbulent inlet an
3:20
outlet then
3:23
slip walls around the wing
Load Data
3:35
once all of your files are set up
3:36
correctly as per previous tutorials you
3:38
simply run the case
3:40
and then load the data in pair view in
3:42
the next part here
3:43
i will show you how to calculate the
3:44
lift and dragon pair view
3:46
and export it into an excel
3:59
[Music]
4:06
[Music]
4:13
[Music]
4:22
[Music]
4:35
[Music]
5:05
[Music]
5:15
[Music]
5:43
[Music]
5:50
so
5:54
[Music]
6:04
so
6:06
[Music]
6:17
[Music]
6:31
[Music]
6:38
[Music]
7:05
[Music]
7:17
[Music]
7:31
[Music]
7:41
[Music]
7:49
[Music]
8:20
[Music]
8:22
the only other parameter that can be a
8:24
bit tricky to calculate is a naught for
8:26
the wings
8:27
with a complex geometry like this one
8:29
you can think of this value as the area
8:31
of the wing
8:31
projected down into the xz plane when
8:34
the wing is at zero degrees
8:35
angle of attack this can be easily done
8:38
in solidworks using the following
8:39
procedure
8:42
[Music]
8:57
[Music]
9:04
[Music]
9:18
[Music]
Results
9:24
here you can see the results i achieved
9:25
after all post processing was done
9:27
the full excel will be provided in the
9:28
github with the rest of the files
9:31
as i mentioned before i do see some
9:32
artifacts from the methodology i chose
9:35
this can likely be lessened with a lower
9:37
value of omega
9:39
the simulation is not perfect i think
9:41
the procedures can serve as a good guide
9:43
but i would change a few things if i was
9:45
looking for professional level
9:47
high precision results the first thing i
9:50
would do
9:50
would be a mesh refinement study this
9:52
will be the topic of the next video
9:54
i would also use a much lower value of
9:56
omega so i can ensure that
9:58
the results i'm seeing are only due to
10:00
the flow and not the angular velocity
10:02
i hope you enjoyed the video and found
10:04
it useful if you enjoy my content and
10:06
want to see more
10:07
please subscribe here and to my patreon
10:09
as well as liking and sharing the video
10:10
if you have any questions please leave
10:12
them in the comments and i will get to
10:13
them as soon as possible
10:14
thanks for watching and stay tuned for
10:16
more content goodbye

Overset meshes with OpenFOAM


and Ansys Fluent | CFD lessons |
Part 4
Oh welcome to this new video
0:03
thou overstep measures we're working for
0:06
the moment without pants on next case is
0:08
we're going to introduce with Philander
0:10
and we're going to compare button is
0:12
this new case so far we have been
0:15
dealing with static meshes the bodies
0:18
under movie so now that's what was
0:20
moving bodies were since to start to
0:22
become really interesting so this case
0:25
by the way in the description you will
0:28
find a link World War two and also this
0:30
is it traditional case with that we have
0:33
done where we have the cylinder and we
0:35
are going to use three measures but I'm
0:37
going to introduce how to do moving
0:40
measure so case using ours over they
0:43
always that approach but I'm not going
0:46
to run the case just to show you the
0:47
mesh then you have to split ready to go
0:50
there so you will see that we have you
0:53
want to do just mash you have to see
0:54
screen does you want to run ever since
0:57
you have this once you want to run the
0:59
solver this wise you in this case we're
1:02
going to use move dynamic meshes okay
1:04
it's also worked with our that meshes so
1:07
we can check all the kinematics here so
1:10
we're using this command okay is we're
1:12
going to run later just comment this one
1:15
coming this one to get the results so
1:18
let's see what we have so I'm going to
1:21
read to generate a match just to see
1:25
what we have so okay and no table will
1:32
use this quiz just to generate image so
1:35
I remember what I'm doing here just
1:36
check this way but if I what recall will
1:38
be silly enough to all refinements on to
1:41
all and everything I'm going to have it
1:43
here you know so we're we're going to
1:45
have our final mesh here yes so what
1:49
we're going to do here we visualize the
1:53
mesh so see that we have the refinement
1:56
bridge in this arena so we're going to
1:57
put this into motion just to see how
2:00
things work but the residency setup
2:03
every semantic relations it is except
2:05
insane now I add a new fusion ability
2:07
which is putting the bodies into
2:11
so let's go into the folder all work
2:14
where well copy them oh oh
2:17
we assembled a hole over that mesh so
2:20
remember in the dynamic mesh dictionary
2:22
here we set up all these old design
2:25
elements dynamic measures so you see
2:28
here we're using the dynamic overset
2:31
mesh library
2:32
okay so remember that this is the
2:35
traditional way you commit this and
2:38
we're working with fixed buddies but now
2:40
that we're working was moving but as we
2:42
set up everything here even the body
2:45
deal the component mesh that is moment
2:47
okay so see that in this case we're
2:49
using multi solid body motion sovereign
2:52
meaning that this one will give you
2:54
opportunities to put different component
2:56
measures into motion and then you give
2:58
the coefficients okay so in this case
3:00
when you put in one son so this one
3:04
takes Shawn so remember that when we do
3:07
such refuse we have some premiums now
3:08
I'm going to show you a tougher sector
3:10
scenario where we compared that region
3:13
into some to have this one okay and you
3:17
have access to different kinematics so
3:20
we're going to use this simple select a
3:22
linear motion okay so it will ask you
3:25
for amplitude and Omega will be in
3:27
radians per second and these are the
3:29
options that you have so you have this
3:31
option let's say that our very complete
3:34
bosses that you will do since
3:36
oscillating or uniform okay motion
3:39
linear motion okay but also remember you
3:42
can program something and even you can
3:45
do you can program a motion animatics
3:49
okay in this version 8 and 12 it is
3:52
supported it is is that color stream but
3:56
you can program that what but there is
3:58
one here that's really handy this one in
4:02
the next tutorial that we're going to do
4:04
I'm going to show you a flop in fall
4:06
that will circulate that a long time ago
4:09
I was working a lot of just putting
4:10
phones in flapping motion and winds so
4:14
probably that motion because we're going
4:16
to put it into e into even impatient
4:20
motion it's not including two in this
4:22
one
4:23
tabulated 6dof motion will let you read
4:28
an input file and in the that input file
4:31
basically you can put any emotion you
4:33
want so this one gives you a lot of
4:35
flexibility but remember you can put
4:37
that one but you want you don't want to
4:39
go through the whole floor and bustle of
4:41
programming just use use this one it's
4:44
very handy okay so in this case see that
4:46
we set up the motion this is the region
4:50
that exists we're going to see later how
4:51
to set up and then the next step let's
4:54
take a look at the boundary condition so
4:56
see that this double spaced under
4:58
computer P&ID
5:01
and we have new so remember the walls
5:04
that involve in that real that's moving
5:07
those walls needs to be a moving wall
5:09
velocity I can't remember that so this
5:11
again there are no it is moving in that
5:13
region that cells are I would be moving
5:16
warble off it so you can put here fixed
5:19
value and it would run but remember when
5:21
it since I'm moving you need to that to
5:23
your equation of the mesh the dimension
5:26
velocity so as you don't put fixed value
5:29
you will get you would get results but I
5:31
can probably around that okay so we can
5:33
for always on you have sense moving
5:35
yours walls moving put moving wall
5:38
velocity and we have point displacement
5:41
okay which paramos it is the same as
5:44
previous testable we have done so you
5:46
have your orcid patches okay so pay
5:48
attention that in this one this is how
5:51
you do the definition and stain the
5:53
other files you just put over sit okay
5:56
so this is a combination how it is
5:57
implemented
5:58
okay patch tight our set types your
6:00
weight okay and then everything is
6:03
uniform uniform x value uniform baggage
6:06
so in theory also you can put a motion
6:08
here so within that over set path that
6:13
component mesh that wall can move move
6:15
inside I have done that when they get
6:19
funky result but I have to say that
6:22
there is no I don't see any reason why
6:25
to put also that but into motion that's
6:27
why we were using over said meshes just
6:30
to avoid that mesh morphing okay so you
6:32
put that there will have mesh Marvin so
6:35
I don't see any reason to
6:36
that and the results are very good so
6:41
that's all the setup nothing else to do
6:43
remember you have to make this so maybe
6:46
this buddy see that in the kinematics is
6:49
like a large amplitudes of probably the
6:52
instantaneous velocities we had the
6:55
first step time step so you will need to
6:57
control that so something interesting
7:00
that also we have faxes when using our
7:03
set meshes or nested solution you have
7:07
need this new in entries check mesh
7:10
current number so I think already
7:12
mentioned that when bodies are moving
7:14
it's a good idea that you choose a time
7:17
step that will let a sequential change
7:20
of cell types okay we are going to see
7:22
this when I talk about when we run this
7:25
case okay but we can check the the mesh
7:29
current number which is different from
7:30
the north from the globe couldn't number
7:33
of the flow okay so because the motion
7:35
the mesh is moving so you have a
7:37
velocity okay and probably this would be
7:39
the most restrictive one because you
7:41
would like to have mesh gonna number
7:44
less than one
7:45
okay so at this point we're ready to go
7:49
okay I think we represent so to run this
7:54
one you go move dynamic mesh I don't
7:57
want to use the function objects okay
7:59
and of you go so remember that I
8:05
mentioned also when you are creating the
8:09
boundary conditions and and emerging
8:11
meshes a good idea that the first patch
8:13
it is the over set one so in this case
8:17
that the first patch is not the our set
8:20
one so we're going to have this warm in
8:22
here okay you really know how to embrace
8:25
this warning okay so they create adding
8:29
that dummy patch I will won't do it but
8:31
you know how to to to deal with this one
8:33
okay but see that we're running move
8:36
dynamic meshes you test you kinematics
8:38
and it will give you the quality of your
8:40
mesh every single Sciences but also will
8:43
show you the depression down during the
8:48
over said
8:49
the ocean measures like the calculated
8:52
cells interpolated cells all every all
8:54
the informations between time here we
8:57
don't see the the current dimension
9:02
number that we need to we need to run to
9:04
see that one okay so first let's check
9:07
the kinematic let's see what we have
9:10
okay so put it here and see this is what
9:17
we have to put it in play motion but we
9:20
have our body into motion so this is the
9:23
idea former set measure so here at this
9:25
point we don't have any limitations in
9:28
motion that with you so we can put this
9:29
body into very strange motion our
9:33
displacement multiple bodies collisions
9:38
so far doesn't handle with solar solves
9:40
and handle collision elastic inelastic
9:42
collisions so give you a lot of
9:47
flexibility but what is interesting but
9:49
you see here that we're moving but then
9:51
you go outside the refinement box so you
9:54
will be adding diffusion you will lose
9:58
memory of solution so it would be a good
10:00
idea to also put this brilliant emotion
10:04
so let's do that
10:04
that is right efficient so we go back to
10:07
dynamic mesh the turmeric and see that
10:10
we already have that definition here so
10:12
we create that some refinement song this
10:16
is in a rosette design and we'll use the
10:18
same boat right now we're going to put
10:20
that review into motion so as you have
10:22
another zone another reason another
10:24
component managed to come put into
10:26
motion they can be totally different
10:28
motion types okay so what is interesting
10:32
let me show you now how to create these
10:33
cell phones so there is this dictionary
10:36
tapa set okay so go here top ascent
10:40
moving son okay this is the one that
10:43
were used to create those zones so
10:45
remember that Lucy will run a check mesh
10:49
and check mesh would tell you is all the
10:51
region so in parable you can identify
10:53
the radius so I already know that 301
10:55
would correspond to the region around
10:57
the cylinder so we're doing this
10:59
topological
11:00
operation here
11:02
to say that I said this name and we're
11:05
going to do now is compare that cell set
11:09
into us on set okay
11:11
I'd be same for the region two that I
11:14
know that written to will correspond to
11:16
refine and Sun okay so as you have many
11:19
different steps you can do all those
11:21
operations here so this is pretty much
11:23
the very straightforward pressure okay
11:26
so let's run this case okay okay and
11:31
don't need to redo the match so let's do
11:34
again moving so let's clean what we have
11:37
for this time - rock and so I press all
11:41
the dice up now I go move dynamic meshes
11:46
of you girls so see that we have good
11:49
mesh all these dances are good no
11:52
problem okay so now let's say what we
11:57
have apply okay stop moving
12:07
let me see what happened here okay sorry
12:10
I forgot to save this one okay so don't
12:13
forget to save that okay let me go again
12:17
so this is ready fast so there's no
12:19
problem okay I go now we are putting the
12:23
two bridges into motion okay let's see
12:29
the final result so now that the
12:40
refinements are on that radio is also
12:42
moving with the cylinder so I were
12:43
wearing to that my Wang behind the
12:46
cylinder will remain north if the way
12:48
safety industry will have good quality
12:51
of cases remember they also mention the
12:54
previous video that is a good idea that
12:56
the transition from this also the other
12:58
one are cannot very similar to avoid
13:00
smearing solution and a numerical
13:02
diffusion also here similar things but
13:05
we are going to spend some differences
13:07
here okay but there is no problem so
13:09
again if you want to add different
13:11
motions feel free to put whatever you
13:13
want so
13:13
this is relative straightforward so now
13:16
I would like to show you the final thing
13:20
so I want to run a few time steps okay
13:23
but just to check the information we
13:27
have okay but also the image of could
13:31
number okay so I will go to Graham
13:34
solver well I thought I don't need to do
13:39
that one I can stay here so for list and
13:46
and I will run a couple steps up
13:50
remember over pimple foam were using in
13:53
this case and I would like to save my
13:56
lock file okay and I go so I see that I
14:01
start to run in okay it's giving me a
14:04
warning that I have a few uh
14:06
functionality but it's basically telling
14:08
me that it's no buddy and finding that
14:10
patch but you can fix that later but see
14:13
that person okay that we see the output
14:18
here and see that somewhere here we have
14:22
the image with a number which should be
14:26
here okay so pretty the before you start
14:31
the people loop you will have finished
14:33
with a number okay so as the bothers me
14:36
is moving okay you have that report so
14:39
it is a quite good idea to have this
14:41
mesh square number less than 1 otherwise
14:43
they would run but you might be have and
14:46
encounter some problems during
14:48
interpolation so I will show you what
14:51
would be those problems ok so that case
14:55
running the new subway so I just want to
14:59
show you a couple stein step okay but
15:01
say that okay it's going up and down so
15:05
you see there's something this
15:06
acceleration it is experiencing very
15:09
large accelerations so here again you
15:11
need to plug the visualization just to
15:14
put the right plan plan in front but let
15:19
me go on for all this times
15:23
and I will do again move dynamic mesh
15:28
okay just to show you also how these
15:30
cells are changing in time okay so
15:33
remember also when you see here this
15:36
part of you folder usually you have a
15:38
part of your files to restoring State
15:40
and I'm going to use that one to restore
15:43
a specific state
15:45
okay of the visualization where we can
15:49
visualize okay just files I choose a
15:53
correspondent here okay so this point I
16:01
don't see anything them okay maybe pop
16:05
you okay let me open your visualize so
16:34
okay we have the measures here so let's
16:38
remember that you have that information
16:40
available some ID and salts type so what
16:43
I was talking I was talking about salt
16:46
type
16:46
so remember cell type 2 means you have a
16:49
whole Salter's one is the interpolation
16:51
fringe okay well you need to play for an
16:54
accompaniment to the other one and two
16:56
is everything calculated
16:57
okay so let's be sterilized what is
17:00
happening here while you mesh is moving
17:02
so I will do a call I will use a couple
17:03
of filters here so we'll press halt to
17:06
spray songs so I want Sun zero okay let
17:14
me stress levels as well so one it's
17:19
been okay will be something here I have
17:24
someone okay sometimes okay someone you
17:29
have it there and let me strap now also
17:33
found
17:35
- okay so 11.4 we are the three sounds
17:42
now we can put a few couplings that one
17:48
don't apply
17:52
okay so we have this coupling here right
17:56
now let's put another coupling in this
17:59
one okay and remember I would shift it a
18:09
little bit okay why I will shifted a
18:12
little bit because I don't want that one
18:15
to overlap with this one so 0.5 okay so
18:21
see there now I shifted in front and I
18:23
will do the same with this one
18:25
coupling there not to this one right put
18:34
it applied no one here and that you have
18:43
the other one okay so we have our three
18:45
planes here and I will put here wire
18:48
friend my friend okay let me travels
18:54
time okay - to annotate a time filter
18:59
once we have time there so I don't want
19:04
to see the light so see what is
19:07
happening here is that this is our
19:11
interpolation area we have a mesh okay
19:18
in the background okay and then this
19:26
amazement sounds okay
19:31
okay let me see the order what I did
19:34
here okay everything okay okay so let me
19:39
put wire from here okay so see that if I
19:44
start to move this one see how it's
19:46
changing okay
19:48
so in this case see that from times that
19:52
0.05 to 0.1 it is a balancing a lot of
19:57
cells and say that it is interpolating
19:59
here okay so you have the whole so you
20:02
are taking information from cells that
20:04
you you don't want okay so this might be
20:07
a problem so this is why it's very good
20:10
idea to have a little mercy feel number
20:15
so this transition from one one times it
20:19
to the other one the transition and the
20:21
cell types it's a very smooth transition
20:23
okay so for instance okay show the only
20:30
this one so see how this transition goes
20:32
okay which produce not IDL you are
20:37
creating a lot of things you are using a
20:39
lot of interpolation just because you
20:40
are using though that that large x so if
20:43
we look at this cell also at this region
20:46
so it will be constant because it's
20:49
moving with the other one okay clean it
20:51
with that one but this is a problem here
20:54
in this in this one so to fix this
20:57
problem what we can do is just reduce
21:00
the time step and we're going to see
21:01
that the chance between Thai stuff is
21:03
the sequential one so let's do it that's
21:06
wrong so just to my promise here so
21:09
we'll save this state so just have him
21:16
here in this case let's reduce go to
21:18
contradiction area and let's reduce the
21:21
time step that's time stood c-101 okay
21:27
so we have a high frequency okay the
21:31
problem wasn't the check may match it
21:33
was like we were all saving the the
21:37
dissolution with a large frequency so
21:39
here in this case we're going to save
21:40
with this frequency that will lost it to
21:45
see the transition in the right way so
21:48
for less time and so let me run again
21:52
this one so we're going to have more
21:56
constant but a better transition from
21:59
level to level
22:00
when the front isit is dying sir when
22:03
the cell types are changing so this is
22:07
the extra overhead that you are adding
22:09
oversight measures of every single time
22:12
that you change from one ties it to the
22:15
other one the solver needs to cook
22:17
recompute all these interpolations do
22:20
all these upper operations so if we're
22:22
going out here I did load steps for this
22:29
purpose is save it there okay so we have
22:34
a version here I guess I will need -
22:38
okay so face off start so I don't see
22:47
the salt up here okay okay there is a
23:00
problem okay I don't know what happened
23:02
with that step so let's do it again
23:04
manually okay so with this case we're
23:08
only interested in the background mesh
23:13
okay we already know what happened with
23:15
your with the other two time moving at
23:17
the same frequency soldered there is no
23:19
change so let's just stretch someone
23:23
okay I want some zero sorry okay and now
23:31
I want a cut line here okay no
23:35
generation and let's be so life stops
23:39
type there and put the mesh so fitted
23:41
mesh go here this place see the
23:47
difference with the previous one that
23:48
and some points you will have three
23:51
frames for interpolation that products
23:54
are like the ability was moving too fast
23:56
in this case we reduce the time steps
23:59
therefore we reduce as well the mesh
24:02
current number and then now we have the
24:05
proper interpolation sequence no
24:08
sequential transference 10 sep
24:14
a petition of your whole curtain and
24:17
interpolation cells and everything okay
24:20
so this is important is that you have to
24:23
be careful okay
24:24
you might be running but probably there
24:27
will be some problem province and your
24:29
interpolation so let's put here for
24:30
instant dissident yourself - okay okay
24:41
and we need to apply the filter here
24:43
and I will like I did you apply okay and
24:50
let me my friend so I'll see what is
24:55
happening here that now these tines that
24:59
we have a sequential change from tiny
25:02
step to tiny stick so remember the
25:04
previous one and you will see that there
25:06
is a bit different now is what we want
25:09
well what is the ideal results okay so I
25:14
think with this and this tutorial the
25:19
next one we're going to work again open
25:21
from moving bodies will be a case
25:23
related to flopping winds intestine will
25:26
be that we're not using anymore black
25:27
mesh now we're going to get dimensions
25:29
from fluent okay we get a data using
25:31
assets measure I want to compare so what
25:34
I'm going to see how to do that one but
25:36
pretty much proportion in the same way
25:37
and we're going to use the table motion
25:40
so I hope you enjoyed this tutorial and
25:43
see you next time bye

OpenFOAM tutorial:
shotSleeveModeling partIII -
Make the mesh moving
hello welcome back this is my third video mm-hmm as part of the open
phone
0:06
tutorial on short sleeve modeling and in part two of this video series I've
0:11
gotten as far as constructing the mesh for a geometry just like this just
like
0:19
the one you see in this figure and now I'm gonna show you how we can
actually
0:24
make this geometry moving and for this purpose we can go back to our
terminal
0:31
and address the most important file for this mesh motion first which is the
0:39
dynamic mesh ticked okay constant folder of your case so jared constant
mesh
0:47
ticked opens it and we can see here that
0:56
as the dynamic mesh mesh of class solid motion so the body motion have
the mesh
1:03
has been selected we don't want that of course because we don't have a
solid body that is the motion is something
1:10
else something that moves ourselves you can just put bananas for
example by
1:18
using the famous banana trick and go back to our terminal sending the
shaded
1:24
in the back and execute move dynamic
1:29
mesh which basically tells open foam to do the solving without the solving
so it
1:35
only um solves for mesh motion but not for the field properties in the CFD
1:40
domain we do this you'll see that bananas of course as we intended as no
1:46
image class and they have to choose one of these the one that I want in
this
1:52
case is dynamic motion solver finish so we just I let it control shift to copy
2:01
SC actually copy something from the terminal paste it in
2:08
Mesnick file save that and do the
2:13
dynamic mesh one more time we will tell them immediate you tell us that
the keyword solver is undefined
2:20
in the dynamic mesh strict so of course good boys girls and I define before
the
2:28
keyword solver since none of us have an idea to put just blah for example
save
2:35
it once more and ask available
2:40
unfortunately in this case it's not that easy because it simply replies solve
of
2:45
tables empty and the reason for this to find out it's not until a
2:50
straightforward but lucky for you I'm going to show you right now how to
fix
2:56
that issue and the problem is that we didn't include the particular motion
so we're just done with this so let's
3:05
grant that's more we don't have any idea what we could actually put there
so I'm
3:11
going to show you how you could equip yourself with at least some ideas
on
3:17
what to put there and you can do this by using the LS command little X
and this
3:23
kick in this case LS for lip bin this will lists all the
3:30
available libraries fortunately the list is pretty long so if we want to get a
rough idea on what we actually you could
3:38
use for our problem we could filter sort of filter they'd lift that list or in
3:44
other words grep with a list with this and with the same Linux command
so I
3:49
don't BLS fill up in one more time and this time I pipe the results of the
grep
3:55
command that grabs all motion for example
4:03
and this gives me the result lip every motions Elvis which is just the one
4:15
control shift see copies it can simply test it - take file save it don't even -
4:27
one more time and Tara will now tell us which types are available and for
this
4:34
tutorial I picked the layered motion and
4:42
in order to give us some ideas with this displacement layered motion sore
4:49
actually leads I'm gonna look at the source code source code first and
since
4:55
I got no idea where the source code is I'm going to use the grep command
little more time and I grab for this place
5:04
layers motion I'm gonna grab the
5:14
directories presently of course this
5:21
tells me there are quite a few files that have this displayed displacement
5:27
layered motion in the name and the one I want is the dot H file first dot H
file
5:32
is the header and this normally gives additional info on how the solver
works
5:39
or at least in this case it does and if I highlight this line that leads to the
5:45
includes the path to the H file let's pull down get it get it
5:51
press the mouse wheel which will paste that to terminal enter and I now I
have
5:59
opened source code the H full of the source code scroll down to the
description and I can see there at the
6:05
mesh motions over at this vegetable turns over for multi black extrude Fe
mesh gets given the structure of the mesh
6:12
blocks and boundary conditions from these blocks and today's
displacement
6:18
layered motion color subject in the dynamics mesh ticked must be defined
I'm
6:24
gonna define the region which is a cell zone and I'm gonna get it to that
later and for this cells are only defines the
6:31
boundary conditions on two opposing patches which means one patch at
the one
6:38
end one pitch at the other end and interpolates the best motion between
6:43
these two patches based on what kind of boundary conditions you specify
for
6:48
these pitches and these patches have to be a zones interpolates as I said
using
6:55
topological walking and therefore acquires a layered mesh which is not a
problem since our blockmeshdict has
7:01
nearly perfect layers available boundary conditions for the face zones are
currently follow which follows the
7:10
overall mass displacement and it uses the proper boundary condition set
in
7:15
point displacement which is another file that the solver needs but I'm
gonna get that later and uniform follow and fixed
7:26
value and time varying fixed value and slip but for this tutorial I'm only
7:32
gonna use fixed value and follow okay I'll leave that open for one more
minute
7:39
but I can already tell you that we won't need this subduction area for the
solid
7:45
body motion every mesh coughs okay get rid of that but instead you need
to
7:50
write another sub dictionary which is called this place motion motion
coughs
8:03
and with a sake of the efficiency of
8:08
this tutorial video I'm not gonna tell you step by step by doing banana
tree going over again how I
8:16
actually got yeah but I'm gonna show you now just simply which
interested would
8:22
wear and as it also said in the for in
8:27
the age file it needs sub dictionary regions and inside the regions it needs
8:35
cell zone and this cell zone I'm going to name moving cells there is right
now
8:42
and the mesh not yet a cell zone that is called moving cells but I'm going
to create that later and I'm gonna show you
8:48
how to create it so please be patient for one more minute or maybe two
and I'm
8:56
going to show you how to create it and trust me that I will get into it we
also need to define the entry interpolation
9:03
scheme and I picked the linear in this
9:10
case and of course we need to specify the boundary field also also
mentioned
9:20
in little H file and the boundary field
9:27
we need to in the to face zones moving faces they also not yet present in
the
9:33
mesh but I'm also going to create them later and the moving faces of
course of type follow today I'll supposed to
9:41
follow the boundary conditions and the other face zone is and if you
followed
9:54
me through part 2 of this tutorial you'll see already probably recognize
10:00
which so which set of faces I'm going to assign to this face so later on
because
10:06
the naming is quite similar to the naming I used when I created the
blockmeshdict ok these are of course of
10:13
type fixed value and the value in this
10:19
case zero because I want them to be fixed
10:27
okay that's that Ross left to be done this
10:33
close each of the sub dictionaries okay
10:48
done you can save this file for now and go back to a terminal and try to
execute
10:57
dynamic mesh one more time I will tell this quite immediately that we
cannot
11:02
find the father point displacement okay
11:10
so what are we going to do now totally
11:16
be best brave of this calls for displacement and we do this by wrapping
11:26
the tutorial files and find one we can
11:37
just easily modify
11:47
so that we got quite a couple of these and we can just simply pick one for
11:55
example example this one which comes
12:02
with interred in foam first I have to create a zero folder
12:10
again because I immediately deleted it when I was deleting all the other
12:16
results and we can copy my displacement
12:28
into that file folder zero folder and
12:36
get it okay there's of course is for
12:44
another case and so we delete everything we don't want of course we
don't have
12:50
any pitch that is called Inlet but we have a patch that is called moving
walls
12:56
for example and touch this cold outlet so this can stay and for the outlet
for
13:03
example we can also keep the fixed value but another Pettit that we also
want to have the fixed value for our fixed was
13:10
so we can combine these two since we want to have same boundary
conditions applied for this by using this regular
13:18
expression open flow unfortunately can read regular expressions so
whenever it
13:23
looks for the outlet boundary conditions or partition or the fixed walls the
boundary condition they will just go
13:29
into this subdivision array which is quite convenient because we don't
have to repeat it in particular if you want
13:34
to make adjustments for adjusting boundary conditions or anything like
that we don't have to do it two times in
13:40
here okay so what else what other pictures do we got we of course got
slip
13:50
walls which is which are the walls where they were
13:55
various sliding along in the slip balls are awful time okay slip walls and as
14:10
you remember the only pitch that is left is the walls and front and back
and back
14:20
and front and back of course off-time ft
14:26
good the only thing that is left to be done
14:32
yes the walls actually because it has to
14:46
be of type solid body motion this place
14:54
don't slow motion displacement and solid
15:07
body what body motion function is linear motion and then the solver is
gets a bit
15:19
weird actually because it once the sub Pictionary linear motion chorus
motion
15:26
quests this is a sub dictionary
15:36
and it needs the entries there once more
15:44
will put emotion functions in the emotion and another linear motion place
15:59
and then in another sub dictionary the
16:05
velocity and now if we remember how we defined our block mesh you will
be able
16:15
to remind yourself that the layers of
16:20
the moving part of the shut slave actually grew into the negative Z
direction so we want the the velocity of
16:27
the mesh mode to be executed in positive Z direction therefore and as I
want to
16:33
have the motion to be one meter per second I put 0 0 1 here which means
one
16:38
meter per second is also the unit
16:44
indicates that we want to have one meter per second in Z direction
16:50
ok so that's it let's put a pair of you
16:57
meter here and it also needs the
17:02
velocity for whatever reason once more inside the linear motion course
17:16
okay so this is about it as far as the board motion at point displacement
file
17:23
is concerned you have the slip walls type empty we got the I know a
mistake
17:31
of course made all the entries for outlet unfortunately I can easily adjust
17:39
that maybe that explode outlet
17:44
I fixed value okay check moving walls type so body motion displacement
with
17:50
all the complicated entries so specified okay this looks this so far look
alright
17:59
so we can save it and the only thing that is now is to do the tapas set of
18:09
the mesh this will be part of next part of next couple of minutes in this
18:16
tutorial and I'm gonna show you how to
18:23
use the top of set dict for that and since we don't have any tough
aesthetic
18:30
which is normally located in this system file see you know tapas at dict in
here
18:36
we need to find one do this by using the grep command once more okay
so should be
18:54
quite a couple of them just normally to set you something you need for
quite a
18:59
lot of quite a lot of quite a lot of
19:06
solders let's just take this one for example multifaceted informed ECT Hall
19:11
and I can take it by just highlighting it once more
19:28
okay copy it just looking gone
20:00
so let me just pick another one
20:16
looks better enjoy it once more
20:25
there it is and what we're gonna do now is modify these actions according
to our
20:33
needs and we have to create to face zones and one cell zone in order let's
20:42
start with the cell zone maybe because this is normally easier we need to
name
20:48
the cells are moving cells and we do this by creating the cell set first so
20:55
the action is a new cell set box to self also it's good and we can go from
minus
21:01
1 meter to 1 meter in X direction because that doesn't really matter we
21:07
want the entire domain we can also go from minus 1 meter to 1 meter in y
21:15
direction and now it gets a bit tricky I'm going to go from go from minus 1
and
21:24
all the way till the end but only till minus 20 minus 3 because all the rest
21:32
should not belong to all the rest should not belong to our moving cells
safe zone
21:41
okay now that we have created the cell said we have to transform the cell
set
21:48
in to face a cell zone and we do this by
21:55
using the newly created cell set
22:02
this time we don't want to sell sap big about yourself though so zone set
22:10
actually is the proper time and action action new okay and then we want
to have
22:20
the source the source in this case is
22:31
this case is set to sell zone set to
22:40
sell zone and source info we have set
22:50
moving cells
23:00
okay so far good and now we have I have
23:08
created or we've created the part about the cell zone next will be on the
face
23:15
zone and yeah we have the proper entry already you can use for example
the I
23:22
knew they would let's start with moving faces first face
23:28
said is okay actually new patch to face I'm not gonna use this one it
should be
23:35
okay but it at some point
23:41
cost me problems which I decided to go for that box to face here box to
face
23:50
and the source info will be box of course I'll just copy this and once
24:01
once again go out from minus one to one
24:07
because it doesn't really matter and I'm gonna go from minus 30 minus
330 you
24:19
minus three okay and for the moving
24:25
faces if you remember they are precisely at minus 300 I'm gonna fall I'm
gonna go
24:31
from minus 3 1 e minus 3 to 299 P minus
24:42
minus 2 9 ok so now we have a face set what do we do well we need to do
24:51
hates the zone or others face set
24:57
we can use the entry here for this purpose underneath ability and we call
25:08
this more than faces face onset and you
25:14
set to face works face it not if 0 but
25:21
faces okay so this is face so number one second face zone yes we don't
need can
25:28
delete it that's just great and logically copy
25:36
these entries and we don't need them and
25:44
the moving faces but as we said boundary
25:50
moving fixed fixed face you set first
26:01
and then a face don't set and we also
26:06
have to adjust the box because we want to now just simply go from - 29 -
3 - 19
26:18
- 19 - 3 which should capture exactly the amount of faces that I write at
the
26:25
boundary between the moving in the fixed area ok so far this thing we
need to
26:34
change is here removing fixed ok
26:49
try that we don't have any typos that's looking good looking good too
27:04
okay let's go to shop
27:12
let's give it a shot by going back to the terminal and type
27:18
double set okay so you know something's
27:25
gone wrong apparently cannot find all
27:32
probably something I should have or did
27:38
I just simply not save it I'll be the problem yes indeed try this one more
27:44
time that looks good so I have now 15 faces in the face head moving faces
they
27:50
have 15 faces in the face set boundary were all removing fixed and also
that 15
27:58
faces in the cell zone and I got 500 2 faces in the cell zone holding cells
28:08
just to make our percent sure that I actually grabbed the right ones home
for
28:16
that
28:33
so they in hope let's see and there it is
28:38
once more I need to make sure that we don't know do not load any fields
okay
28:50
okay but I don't want to load the internal mesh this time I don't want to
include the zones and I want to include
28:58
I want to show moving cells cell zone supply whatever reason they
selected the
29:12
internal mesh again so if I deselect the internal mesh this part disappear
look
29:20
at that it does so that worked and
29:35
you see the moving faces
29:42
they are here they're supposed to be but for whatever reason you can't
see the
29:47
boundary or is it just yes yeah there it is check this to see just
29:54
as I one of them opposing to opposing face zones that are inside oneself
zone
30:01
where it's supposed to calculate the mesh motion are ok with having set
up
30:08
the files just as mentioned there's one more thing to be done which is in
this
30:14
case adjust the control duct you can do
30:20
this by opening it and I want to set the
30:26
end times to 125 because I wanna have it
30:35
compressed and not having the best move beyond its actual target and
right
30:41
interval can stay I think and I just decrease it increased the time step
30:47
because the mesh motion is normally known not to be super time
sensitivity
30:52
time sensitive and I can also delete all
30:59
these functions from the control deck because we don't need them here in
this case and yeah okay so that looks alright
31:09
for now let's see if I'm right this estimation I can just try to do the move
31:15
dynamic mesh see what's working
31:27
looking okay please that's solved all the way to the end
31:43
okay good just deselect make sure the
31:48
blunt feels that D selected once more click apply I see the internal mesh
pick one of
31:56
these and if you click here on adjust camera and say roll - 90 they also
have
32:04
the proper orientation so service with edges and you can see now does
exactly
32:15
the mesh motion as we intended it to do so we can put a check behind
that and
32:22
proceed to the next part which will be the adjustment of the boundary
32:28
conditions so I conclude about three of the tutorial now maybe one's more
32:34
foreign for your intention and see you back at part four

Adaptive Mesh Refinement


Working Session 1: Node
Coordinates and Connectivity
(OpenFOAM)

Overset meshes with OpenFOAM


and Ansys Fluent | CFD lessons |
Part 5
hello welcome back again to the series
0:03
of videos about our set measures so
0:06
before moving to our worship measures
0:10
and fluent this will be what last video
0:13
was up and fun for your moment and we're
0:17
going to deal with so was flapping
0:19
mirror Falls even ambition or fall so
0:23
I'm going to introduce you at our input
0:26
input to to set up that that motion so
0:29
in the link in the description you will
0:32
see the word toodle-oo this fat so
0:35
basically we have to destructors see
0:37
here that image we have the measure that
0:39
we generated using an sis measure fluent
0:42
so here now we're doing everything that
0:44
diminishes generating a total in a
0:46
completely different environment
0:48
so pretty much we work in the same way
0:50
we only need just to compare the meshes
0:52
and so far to our knowledge you can use
0:56
any type of cell so in this case we're
0:58
going to work with quite some triangles
1:01
but we have few sources what polyhedron
1:03
was no problem so we're going to compare
1:05
the mesh we're going to put everything
1:07
in the folder background so in there for
1:10
chimera to match them put it in
1:12
background and we're going to set up
1:14
ever since so let's go to the flap in
1:19
for case and let us generate a mesh so
1:25
nothing new here so we have it there so
1:29
just to show you the instead of these
1:33
different steps I'll say that instead of
1:35
doing using black mission happy whatever
1:37
we're converting image from fluent okay
1:40
it's a 2d mesh so I also set in the
1:42
dimension so one one here get image from
1:46
there and then turn four just to shift
1:48
these they are fall and then here we do
1:51
the emergence of the meshes and see that
1:54
here what is the capacity the political
1:57
manipulation where we're going to get
1:59
what is the the region that is moving
2:01
okay in this case we're not using the
2:04
check mesh with the ranch at mesh the
2:07
pretty much water in the same way so is
2:09
your open top aside it was
2:11
that you know the we already know that
2:13
this this set sells my name is c0 c1 so
2:18
using those I'm putting that point in
2:20
those you can start those regions and
2:22
then top assert moving some we assign
2:25
the we create the this cell stone okay
2:28
so we have this all set and then we just
2:33
give it a name of in Sun I'm gonna we're
2:35
done okay so this is it the other way so
2:38
remember check mesh will identify those
2:40
regions but it's you don't want to check
2:43
myself or any recent check mesh then
2:46
identify those radios you can use the
2:48
opposite so say that you put a point
2:50
somewhere your mesh and then do is
2:52
trapdoor yourself so so it's a region to
2:56
sell so okay so it's this point belongs
2:59
to a region will start with that region
3:03
is if it the point the real most that
3:05
gradient this case we get one region
3:08
there's another different operation and
3:10
just get the second video given borrow
3:12
of the first one so you will understand
3:15
that so as you look also here the screen
3:18
see that after we run check mesh you
3:21
have also the reduce identification here
3:23
so we ha ha we could have to use all
3:26
instead of doing this double set region
3:28
see everyone but just to show you
3:30
another wife
3:31
muscles it either prefer to to work with
3:33
you check mesh we have hold it for my
3:35
from there so now that we have
3:36
everything we're going to background
3:39
work with simpler all the measures the
3:42
component measures and let's take a look
3:44
at the difference here okay
3:45
so instead of using the oscillating or
3:50
linear motion here we're going to use an
3:52
input file so it's your often dynamic
3:54
mesh dictionary burst either a
3:57
dictionary the same then multi-multi
4:00
solid but the militia wishes with most
4:02
general wine also you have solid body
4:05
motion solvable so single one but my
4:08
advice just put it put multi that means
4:10
that you can fix or reuse into motion
4:13
songs into motion again we know the name
4:16
of this all set and we want to put it
4:19
into motion so to put it into motion
4:21
we basically
4:23
use these three lines okay so start by
4:27
the motion function tolerated six
4:29
degrees of freedom motion we give a
4:31
center grab your center of rotation okay
4:35
because this is also rotating but it is
4:37
rotating about this point and then turn
4:40
data file table so it for this table
4:44
we're going to read the position of the
4:48
body in time so I will show you how is
4:50
this table this very standard form so
4:54
first the number of samples or lines
4:58
that you have to endure in your table so
5:00
we have a thousand lines then first of
5:02
all you have time time time then you
5:06
have displacement and then you have
5:08
angle
5:09
okay so berries so in this case were
5:12
given the displacement in time it is
5:14
just so low function so is the y-axis I
5:19
see that you have the displacement but
5:21
also we have the rotation which is about
5:23
the axis set the one normal to your
5:26
screen and that's all she said
5:29
as you see this one will give you
5:30
incredible flexibility inserting the
5:33
motion you can do whatever you want and
5:36
as you have seen you have even have any
5:39
limitation on the displacement okay so
5:41
this motion we are really created you
5:44
can use what everyone Excel MATLAB
5:47
Python any program you need to create
5:49
this table and then you put it in this
5:53
very standard and this is standard form
5:55
then you go to boundary conditions they
5:58
are exactly the same nothing change also
6:01
here were added turbulence modeling
6:03
towards mother nothing church the only
6:06
things that remember that you have the
6:07
new patch there were setbacks but the
6:10
rest wall functions everything it is
6:12
exactly said okay the wreath in here
6:14
that the body remember it is moving the
6:17
world earful should be moving wall
6:21
velocity and then you have the point
6:22
displacements this very standard setup
6:25
as you see nothing change okay
6:28
even turbines modeling the treatment it
6:32
is the same okay so the only new thing
6:35
that we have years this windy
6:37
and then the overset treatment this over
6:40
will compute how these cells are
6:42
changing okay did the tax of the cell so
6:45
it will go from blog to interpolation to
6:48
solve cells and remember that you will
6:50
like to have a mesh CFL number or
6:53
couldn't number that is small enough to
6:56
warrant a that the church between cell
6:59
type is sequential this bill
7:01
smooth-faced know that I lost your step
7:03
like without in the previous case on who
7:06
stole is that case ok so at this point I
7:08
think we're ready to to go something
7:11
else to show you you know you go to a
7:15
screen everything is pretty much the
7:16
same ok nothing change we have to study
7:19
all the entries so far so this case to
7:24
run ok you have more dynamic man this
7:27
one is a little bit more time-consuming
7:28
doesn't mean it will say what I was just
7:30
probably five minutes I want to run that
7:32
what because we we need to run a few
7:34
tests it's already happy compute the
7:38
motion here and I'm going to show you
7:40
what we'll have here paraffin and I will
7:43
work to show you the mesh so look at the
7:45
mesh so we have to measure iterated
7:48
influence so see that we have the
7:50
background mesh which is what I let
7:53
Domon but also you have some triangles
7:55
and they say that you have the what
7:57
about the air flow it is made of
7:59
triangles and then close to the body
8:01
also we have two prismatic border layer
8:03
so as you see you have any limitation
8:06
how you put how you use your souls that
8:08
can come from any measure you just need
8:10
to convert it to the open phone for me
8:13
so let's do here the traditional way to
8:16
do the post processing so remember that
8:19
we need to start from celso's it's all
8:24
at the bottom fills we apply some
8:26
thresholds here so I want to stress
8:28
someone on 2k so that mister edsall zero
8:33
and then it was trap here
8:39
okay some walk so we have the two sums
8:42
here everything fine
8:47
okay let me be here so faced with
8:49
smashes Oh smashes let me create the car
8:53
plans as well so also about probably one
8:59
day and if you're trying out whoever to
9:01
create a I hope to talk about part of
9:04
you is a very powerful tool so there are
9:07
manipulation but everything that I do it
9:08
here is you do this continuously you can
9:11
parameterize these and you can create
9:13
your Python squid I have Python for this
9:16
somewhere but I don't recall what I put
9:18
it so let me put another one here okay
9:30
this one I will shift it as well a
9:32
little bit too far enough that one to
9:35
avoid it over Lane um well we are ready
9:42
there right here okay no white
9:50
background and if I press play see what
9:54
we have so it is rotating so you give
9:57
the initial position and then everything
9:59
is struck from there so basically you
10:02
will see that you've got you have
10:04
incredible flexibility
10:06
okay when doing since when I mentioned
10:08
the previous video that you can also do
10:10
more finishes within this over or a
10:12
component mesh so this case we have the
10:16
flop in airflow nope
10:18
the airflow undergoing even pitcher
10:20
motion but also there is deformation in
10:22
the air okay so you can do it the
10:25
results are not very encouraging but it
10:29
was okay it takes a little bit too early
10:31
will do some of the options okay at this
10:35
point that means let's see what we have
10:38
when the cells are changing in time so
10:41
remember those are these cell types so
10:44
let's visualize
10:45
sometimes background and this one also
10:50
wireframe and so tight okay so just to
10:55
show you so see what we have here look
10:57
at that interpolation from here okay
11:00
so briefly we oversee so when I squat
11:03
though now is fallen with the shape of
11:05
those elements so all around we're
11:08
worried or polite them and then we have
11:11
the background so it's important in the
11:14
background we mentioned that you need to
11:17
have a small enough time step so you can
11:21
have fast change when you are
11:25
recomputing all these cells the computed
11:27
interpolated cells area so it needs to
11:30
be small to have a very sequential
11:31
motion from one cell type to the older
11:34
cell type so if press play here look at
11:37
that as it is moving this very small
11:40
sequential okay so probably it would be
11:43
a good idea to have a finer mesh here
11:47
see that probably were risking some not
11:51
very good interpolation but it was okay
11:54
there is no problem so in the next
11:56
tutorial we're going to work with fluid
11:58
and you're going to see something very
11:59
interesting about the way how open for
12:02
wars and how can this information Terp
12:05
elation or the whole cut in memory is
12:08
the one that used to find the hole here
12:11
can be improved okay so here we're not
12:14
minimizing the interpolation area
12:16
instead in fluent we're going to have
12:18
the option we are going to compute this
12:20
mentioned you are going to see that
12:22
pretty much who have very much solution
12:24
results but then when we applied the
12:28
minimization of this overlapping areas
12:30
you will see that we're going to have
12:32
less sales and a much better
12:35
interpolation better resource so let's
12:39
see what else I can add here so pretty
12:42
much yes finally
12:44
fast tutorial is about 20-25 minutes the
12:49
first one was 40 minutes so at this
12:52
point we again I hope you master
12:55
overset meshes so you have tutorial feel
12:58
free to run all these tutorials play
13:00
around with the options you will find
13:03
some comments and all the tutorials and
13:05
well from this point on we're going to
13:09
most affluent and after others in few
13:12
issues in fluent
13:13
the last tutorial will be a comparison
13:16
between flu and open for but using great
13:18
body motion which is the missing part ok
13:20
so far we we are signing prescribed
13:23
motion that would be the last part okay
13:25
really body motion but again pretty much
13:27
things are different but there are a few
13:29
new pick you like this so I hope you
13:33
enjoyed this tutorial and see you next
13:35
time bye

You might also like