This is really good. You are a great presenter. I will recommend it to my friends. If you need some help in preparing the material and research let me know trough a DM, this in particular was something I could help you with. Next in the line could be gradient (slope) limiters, they logically follow this topic.
@@fluidmechanics101 Yes I do, a good plan would be to show Barth-Jespersen, Venkatakrishnan, or Wang modified Venkatakrishnan limiter, since this one is implemented in Fluent and Multidimensional limiter. I can forward papers for these.
Very good explanations. In equation 23, however G is a singular matrix, since it has a zero entry in the diagonal position. Consequently, it is not possible to get the inverse of G. This comes from the fact that the example is shown in 2D but the third dimension is introduced in the matrix construction. It would be better to avoid this situation.
Yes, well spotted. I should really have left G as a 2 by 2 matrix in the example. I suppose i was trying to keep the derivation applicable to 3D CFD codes (as that is what most people use). But yes, you are correct! Apologies is this has confused anyone
I think OpenFOAM's leastSquares implementation is vulnerable to the singular matrix problem. How about replacing the inverse with the Moore-Penrose inverse (i.e. psedo-inverse) routine?
Thank you, Aiden for the useful lecture! I have a small point to mention, in 9:05 the quadrilateral cell is used for 2D, so the gradient would actually contain 2 components and not 3 (we know the 3rd component). So our unknowns are actually 2 and not 3. Similarly, for the distance vector, it will only contain two components. Therefore, the system size would be (4X2) * (2X1) = (4X1) Of course, that doesn't mean it's incorrect, but I just thought to bring this out :)
Sure thing. I have some pretty thorough examples in the Udemy courses (see links in the description if you are interested). They are pretty cheap, or you can always get the textbook by Versteeg and Malalasekeera if you would prefer a classic textbook
Thank you very much for the video. Considering that the least-squares method does not use the face values, what about boundary faces? Is there a special handling for these, or are they ignored completely? I can see fixed-value boundaries being included in this scheme, but for fixed-gradient boundaries it seems it would be more complex.
Hello Adrian, Great video again. 1) So this weighting function, Doesn't it land up compromising the gradients above the prism layers, as 1/d would land up becoming very small ? 2) Can we do something like , use the weighting function approach for all cells having "d" smaller than a specific value (defined through some criteria) / or maybe just for prism cells and then use the original formulation for the rest of cells?
Yep, that sounds right to me! I dont know how CFD codes actually handle this, i presume they have a setting to correct prism layers ... but i cant be sure
Hi, thanks for this very didactic video. Between the Least-Squares (without weighting) and the Gauss method, which one is more appropriate for a mesh with high aspect ratios near to a boundary?
I can't quite remember off the top of my head but I am pretty sure Gauss method is preferred with high aspect ratio cells because of the weighting coefficients
In equations 34 and 35, the transpose of W is not necessary as it is a diagonal matrix. It does not actually show during derivation. So dropping out this term would be more appropriate ?
Correct, the transpose is not necessary. I decided to leave it in, for people who are following along with the references (it is often confusing when terms disappear without explanation, so i left them in). Thanks again for your careful checking 😊
I would like to but I have to admit, I haven't quite worked out how they work yet ... 😅 I have almost worked it out but probably not yet at the level needed for a good video!
Hi, Dr.Adrian. Thanks for your high quality explanation. in the code we are using, under FVschemes, I can not find grad(U). it seems like we dont specify anything for grad(U) at all. gradSchemes { //default iconCellLimited Gauss linear; //default cellLimited leastSquares 1.0; //default cellLimited iconGauss 1; //default GLSQ linear; //default iconGauss; //default WLSQG; //default Gauss linear; //default cellLimited Gauss linear 1; default iconCellLimited iconGauss; grad(rhog) Gauss linear; grad(rho) Gauss linear; grad(p_rgh) Gauss linear; grad(p) Gauss linear; grad(alpha) Gauss linear; grad(sigmaf) Gauss linear; grad(pa) Gauss reverseLinear; grad(cellDisplacement) iconCellLimited Gauss linear; }
Sir , i am an undergraduate student of mechanical engineering , i am currently trying to implement my knowledge on CFD and understand it in-depth. I believe it would be extremely useful if you made a video of the order that CFD solves - iterates all these equations. What do we mean by initialization , what is the first thing the code does etc. If there is already a video , please , guide me through. Thank you in advance.
Hi there. Initialisation is just a process to get the initial condition (initial value of the flow variables). For most algorithms, the velocity and pressure correction equations are solved first, followed by energy and turbulence, within a loop of the SIMPLE Algorithm. This will vary for multiphase flows and some CFD codes may implement their own order
hello, if i understand correctly from this and the past video, we use thegradient scheme to calculate the gradients in the center of a cell for a variable, and if the mesh is screwed we should use green gauss node based or least squares as they give us less error from the mesh. what i am little bit lost is why at least in OF, we can choose different gradients schemes for each variable, if it is something related to the mesh why would you choose different schemes for same mesh but different variables? to make the calculations faster when the gradient of that variable does not matter a lot? thanks!
Yep, OpenFOAM always gives you the option to use different schemes for different variables. For gradient, there is no real reason to use different schemes for different variables. I would just use the same scheme for all variables 👍
@@fluidmechanics101 thanks for the clarification!!! I was visiting your patreon page that i was thinking maybe to participate, i saw some of your videos and as another user said, i feel guilty pleasure of prefere watching your videos instead of a serie ahahaha. have you thought about a series about aplication in a software? for example combining OF and the same time as theory ? I have not see a lot of people that goes in theory when explaining tutorials of OF. would be great!
@@fluidmechanics101 could be interesting to do different Cases as different solvers... For example I need to finish your video in piso algorithm ^^. But there is reacting flow, combustion... As you explained here the grad schemes, fvoptions... I am not 100% surs, but could be something different.. ^^ if you need I could send all the different sources I have from people that explains of 🤔😉
In least square method of gradient calculation (for unstructured grid where corner cell contact is present for some cells)..can we use corner cell's cell centroid value along with face neighbors cell centroid value? Why calculation involved only face neighbors cell centroid value?
The reason for using face neighbours cell centroid values is we generally do not know how many cells each cell is connected to. So the method is general and can be applied to any cell, regardless of its connectivity
This is really good. You are a great presenter. I will recommend it to my friends. If you need some help in preparing the material and research let me know trough a DM, this in particular was something I could help you with. Next in the line could be gradient (slope) limiters, they logically follow this topic.
Yes! Exactly what i was thinking. The slope limiters seem quite tricky though. Do you have any good resources? (Papers, links etc)
@@fluidmechanics101 Yes I do, a good plan would be to show Barth-Jespersen, Venkatakrishnan, or Wang modified Venkatakrishnan limiter, since this one is implemented in Fluent and Multidimensional limiter. I can forward papers for these.
You are awesome. Thank you, Dr. Wimshurst!
Very good explanations. In equation 23, however G is a singular matrix, since it has a zero entry in the diagonal position. Consequently, it is not possible to get the inverse of G. This comes from the fact that the example is shown in 2D but the third dimension is introduced in the matrix construction. It would be better to avoid this situation.
Yes, well spotted. I should really have left G as a 2 by 2 matrix in the example. I suppose i was trying to keep the derivation applicable to 3D CFD codes (as that is what most people use). But yes, you are correct! Apologies is this has confused anyone
I think OpenFOAM's leastSquares implementation is vulnerable to the singular matrix problem. How about replacing the inverse with the Moore-Penrose inverse (i.e. psedo-inverse) routine?
I love these videos. So clear. Thank you.
Excellent video! This really clarified the topic for me!
Thank you, Aiden for the useful lecture!
I have a small point to mention, in 9:05 the quadrilateral cell is used for 2D, so the gradient would actually contain 2 components and not 3 (we know the 3rd component). So our unknowns are actually 2 and not 3.
Similarly, for the distance vector, it will only contain two components. Therefore, the system size would be (4X2) * (2X1) = (4X1)
Of course, that doesn't mean it's incorrect, but I just thought to bring this out :)
Yep, I agree 👍
Thanks man. You are a good teacher!
Thank you so much for your videos! I am new to FVM and you make itso intuitive.
Wow~lots of useful videos. Thank you for saving me master degree.
excellent presentation, I wish you extend LS, to the actual numerical solution of a PDE such as Poisson equation in a 2D geometry
Sure thing. I have some pretty thorough examples in the Udemy courses (see links in the description if you are interested). They are pretty cheap, or you can always get the textbook by Versteeg and Malalasekeera if you would prefer a classic textbook
Thank you very much for the video. Considering that the least-squares method does not use the face values, what about boundary faces? Is there a special handling for these, or are they ignored completely? I can see fixed-value boundaries being included in this scheme, but for fixed-gradient boundaries it seems it would be more complex.
Yes great question. They are handled differently and I haven't really had a chance to go into this yet 😅
Hello ,Good Video as always Thank you very Much
Hello Adrian, Great video again.
1) So this weighting function, Doesn't it land up compromising the gradients above the prism layers, as 1/d would land up becoming very small ?
2) Can we do something like , use the weighting function approach for all cells having "d" smaller than a specific value (defined through some criteria) / or maybe just for prism cells and then use the original formulation for the rest of cells?
Yep, that sounds right to me! I dont know how CFD codes actually handle this, i presume they have a setting to correct prism layers ... but i cant be sure
Hi, thanks for this very didactic video. Between the Least-Squares (without weighting) and the Gauss method, which one is more appropriate for a mesh with high aspect ratios near to a boundary?
I can't quite remember off the top of my head but I am pretty sure Gauss method is preferred with high aspect ratio cells because of the weighting coefficients
@@fluidmechanics101 Ok, I was wondering that too. Thank you :)
Useful and interesting
In equations 34 and 35, the transpose of W is not necessary as it is a diagonal matrix. It does not actually show during derivation. So dropping out this term would be more appropriate ?
Correct, the transpose is not necessary. I decided to leave it in, for people who are following along with the references (it is often confusing when terms disappear without explanation, so i left them in). Thanks again for your careful checking 😊
Thanks for another great video! Any plans to make video on slope limiter schemes (Venkatakrishnan etc) ?
I would like to but I have to admit, I haven't quite worked out how they work yet ... 😅 I have almost worked it out but probably not yet at the level needed for a good video!
@@fluidmechanics101 all the best! It is a tough thing to tackle.
thank you, good sir!
Hi, Dr.Adrian.
Thanks for your high quality explanation.
in the code we are using, under FVschemes, I can not find grad(U).
it seems like we dont specify anything for grad(U) at all.
gradSchemes
{
//default iconCellLimited Gauss linear;
//default cellLimited leastSquares 1.0;
//default cellLimited iconGauss 1;
//default GLSQ linear;
//default iconGauss;
//default WLSQG;
//default Gauss linear;
//default cellLimited Gauss linear 1;
default iconCellLimited iconGauss;
grad(rhog) Gauss linear;
grad(rho) Gauss linear;
grad(p_rgh) Gauss linear;
grad(p) Gauss linear;
grad(alpha) Gauss linear;
grad(sigmaf) Gauss linear;
grad(pa) Gauss reverseLinear;
grad(cellDisplacement) iconCellLimited Gauss linear;
}
Sir , i am an undergraduate student of mechanical engineering , i am currently trying to implement my knowledge on CFD and understand it in-depth. I believe it would be extremely useful if you made a video of the order that CFD solves - iterates all these equations. What do we mean by initialization , what is the first thing the code does etc. If there is already a video , please , guide me through. Thank you in advance.
Hi there. Initialisation is just a process to get the initial condition (initial value of the flow variables). For most algorithms, the velocity and pressure correction equations are solved first, followed by energy and turbulence, within a loop of the SIMPLE Algorithm. This will vary for multiphase flows and some CFD codes may implement their own order
Hey Aidan. Is this least squares gradient scheme similar same as levenberg algorithm?
hello, if i understand correctly from this and the past video, we use thegradient scheme to calculate the gradients in the center of a cell for a variable, and if the mesh is screwed we should use green gauss node based or least squares as they give us less error from the mesh. what i am little bit lost is why at least in OF, we can choose different gradients schemes for each variable, if it is something related to the mesh why would you choose different schemes for same mesh but different variables? to make the calculations faster when the gradient of that variable does not matter a lot? thanks!
Yep, OpenFOAM always gives you the option to use different schemes for different variables. For gradient, there is no real reason to use different schemes for different variables. I would just use the same scheme for all variables 👍
@@fluidmechanics101 thanks for the clarification!!! I was visiting your patreon page that i was thinking maybe to participate, i saw some of your videos and as another user said, i feel guilty pleasure of prefere watching your videos instead of a serie ahahaha. have you thought about a series about aplication in a software? for example combining OF and the same time as theory ? I have not see a lot of people that goes in theory when explaining tutorials of OF. would be great!
Yea this is something i am thinking about doing. Maybe a complete case from start to finish in OF?
@@fluidmechanics101 could be interesting to do different Cases as different solvers... For example I need to finish your video in piso algorithm ^^. But there is reacting flow, combustion... As you explained here the grad schemes, fvoptions... I am not 100% surs, but could be something different.. ^^ if you need I could send all the different sources I have from people that explains of 🤔😉
In least square method of gradient calculation (for unstructured grid where corner cell contact is present for some cells)..can we use corner cell's cell centroid value along with face neighbors cell centroid value? Why calculation involved only face neighbors cell centroid value?
The reason for using face neighbours cell centroid values is we generally do not know how many cells each cell is connected to. So the method is general and can be applied to any cell, regardless of its connectivity
Does it work if one uses the Moore -Penrose Pseudo Inverse?
That is what is used.Solution found using Moore Penrose Pseudo Inverse has the property of satisfying the least squares problem
Can u please recommend good books for CFD
Does anyone know if the ansys least squares gradient scheme is automatically weighted?
I don't think anyone can be sure unless they work for ANSYS. The best we can do is guess from the user manual 😅