tag:blogger.com,1999:blog-1308139960516080412.post5738881285201456467..comments2021-10-05T08:45:24.229-05:00Comments on Christopher Simpson: Temporal and Spatial Stability Analysis of the Orr-Sommerfeld EquationChristopherhttp://www.blogger.com/profile/14768438682715700162noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-1308139960516080412.post-36918711525348556202021-10-05T08:45:24.229-05:002021-10-05T08:45:24.229-05:00hi can you give access to matlab file ?
thank you...hi can you give access to matlab file ? <br />thank youwadehttps://www.blogger.com/profile/03952692459554147558noreply@blogger.comtag:blogger.com,1999:blog-1308139960516080412.post-46500588102797899512020-11-17T14:03:33.086-06:002020-11-17T14:03:33.086-06:00Thanks for the awesome work! I have a quick questi...Thanks for the awesome work! I have a quick question about the assumption made in the code. Is the flow for this problem considered inviscid or are the viscous terms included?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1308139960516080412.post-25628260867251852062017-03-28T08:57:31.758-05:002017-03-28T08:57:31.758-05:00How can I use de contour command? What are the arg...How can I use de contour command? What are the arguments?Jonatashttps://www.blogger.com/profile/07022041947105199452noreply@blogger.comtag:blogger.com,1999:blog-1308139960516080412.post-68342395728123322792017-02-15T03:09:17.147-06:002017-02-15T03:09:17.147-06:00How to change the boundary conditions here?How to change the boundary conditions here?sashilhttps://www.blogger.com/profile/12788662492842901850noreply@blogger.comtag:blogger.com,1999:blog-1308139960516080412.post-9731468119931216652017-02-15T03:06:33.800-06:002017-02-15T03:06:33.800-06:00Hello sir, I didn't quite understand the objec...Hello sir, I didn't quite understand the objection you have raised here.sashilhttps://www.blogger.com/profile/12788662492842901850noreply@blogger.comtag:blogger.com,1999:blog-1308139960516080412.post-63769750187506497982017-01-09T10:56:24.692-06:002017-01-09T10:56:24.692-06:00Amazing work man....can't thank you enough!
Co...Amazing work man....can't thank you enough!<br />Could you help me on what I need to change to change the velocity profile?<br />Thanx in Advance!<br /><br />Anonymoushttps://www.blogger.com/profile/04564383704595606582noreply@blogger.comtag:blogger.com,1999:blog-1308139960516080412.post-24934423421688787512016-01-17T10:19:29.044-06:002016-01-17T10:19:29.044-06:00Hi Christopher,
I posted a question here:
http:/...Hi Christopher,<br /><br />I posted a question here:<br /><br />http://math.stackexchange.com/questions/1615447/orr-sommerfeld-equation-blasius-boundary-layer<br /><br />I was wondering if you could help out with this?<br /><br />Thanks!<br />JAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1308139960516080412.post-6142645702457933432015-07-30T09:14:31.913-05:002015-07-30T09:14:31.913-05:00Ok, thank you for your reply. That clears things u...Ok, thank you for your reply. That clears things up :) maxiantorhttp://maxinator.bplaced.netnoreply@blogger.comtag:blogger.com,1999:blog-1308139960516080412.post-27947001756307104352015-07-26T21:05:49.083-05:002015-07-26T21:05:49.083-05:00First of all, thanks for the feedback. I'm gla...First of all, thanks for the feedback. I'm glad to see someone is actually benefiting from my work. That makes it all worthwhile. I'll try my best to answer your questions here.<br /><br />"I think you meant $\overline{\Phi}'(0,\infty)=0$ the second time (prime missing)"<br />Thanks for spotting that mistake. I have updated the post.<br /><br />"Some explicitly shown matrices, instead of only the general band structure, would have helped understanding a bit more."<br />Noted. Ordinarily, I would have left the terms in the matrix, but I am constrained by the size of the page. My goal is to explain things clearly enough that you don't need to view the source code to understand the process. I'll try to be better about that in the future.<br /><br />"I also wonder how you made this blog entry. Did you write this in latex? If so, which latex2html converter did you use?"<br />I use MathJax for the math. It allows me to use latex-style math inside the Blogger editor. You use \ ( and \ ) around inline formulas (without the spaces) and \ [ and \ ] around displayed formulas. I don't know if it works within comments. I guess I can try. \(x=3\) \[x=3\] If those are rendered, it works.<br /><br />"About these boundary conditions I'm really really unsure about what was done and so on."<br />That is all my fault. I had to go back and look at my code to see what I was actually doing. Shame on me. What is not clear in the post is that I am using backward difference to approximate \( \phi' \). Since \( \phi'_0 = \phi_0 = 0 \), this gives \( \phi'_{-1} \approx 0 \). I then apply the central difference method to approximate \( \phi''''_1 \) (just inside the wall), where my stencil includes nodes -1, 0, 1, 2, and 3.<br /><br />"The problem with that approach is the error scaling!"<br />I think you are right. I should have gone with a forward differencing scheme near the boundary instead. That's what I get for rushing things.<br /><br />"I'm also really really not sure about this step. I see why one could remove the first and last column, i.e. because $\Phi_0=0$, but the first row is an equation for $\Phi_0$ and this equation is only trivial if maybe $\Phi''(0)=0$ and $\Phi''''(0)$."<br />The first and last rows can be removed because we already know a value for \( \phi \) at the boundaries. If you only delete the columns, I believe you would find that you have two linearly dependent equations that reduce to 0 = 0. This is common practice when applying boundary conditions in finite difference equations.Christopherhttps://www.blogger.com/profile/14768438682715700162noreply@blogger.comtag:blogger.com,1999:blog-1308139960516080412.post-41032491529636407002015-07-26T16:17:51.703-05:002015-07-26T16:17:51.703-05:00Note that I used some mix of CDS and FDS for the 4...Note that I used some mix of CDS and FDS for the 4th derivative, because I don't want more than one function value to lie beyond the border, because I can only eliminate one value with $\Phi'(0)=0$.<br /><br />You can test everything about the error scaling and inserting the boundary condition e.g. with $f(x)=\arctan(x)-\frac{x^6}{12} - \arctan(1) + \frac{1}{12}$ like I did. This function has $f(1)=0$ and $f'(1)=0$, so you can test it at $x=1$.<br /><br />\section{Removing first and last row}<br /><br />I'm also really really not sure about this step. I see why one could remove the first and last column, i.e. because $\Phi_0=0$, but the first row is an equation for $\Phi_0$ and this equation is only trivial if maybe $\Phi''(0)=0$ and $\Phi''''(0)$. That just what I did, because without removing these rows I don't know how to solve the eigenvalue equation. It's possible to reason that the boundary conditions are only to limit the spatial width of the perturbation wave function, so it wouldn't be all that wrong to say that higher order derivatives also go to $0$ at infinity or 0. This should only narrow the wave down a bit.<br /><br />Simply saying $\Phi_{i-2}=0=\Phi{-1} = 0=\Phi_{0}$ is also dangerous I think. This is what you basically did by using BDS. But this can also be seen as the statement, that $\Phi(x<0)$ is completely 0 beyond the border. But this would mean $\Phi$ is a piecewise function. And then this would mean that we tried differentiating this piecewise function at the critical point $x=0$ where it changes form with a CDS! But a CDS may not be defined at that point. Only pure BDS and FDS would be defined there and they would most likely not be equal with BDS always being 0 and FDS not!<br /><br /><br />\section{Comparison}<br /><br />So I compared my solution using your Matrix A and B with my solution using a tad different boundary conditions like reasoned above. The only difference I could spot was a small shift of the thumb curve to higher Re (maybe Faktor 1.3). And the thumb curve looks a tiny bit thicker.<br /><br />here is $A_4$ which I use for $\Phi'''' =: \frac{A_4}{h^4} \vec{\Phi}$:<br />\begin{lstlisting}[language=Python]<br />A4 = np.zeros( [N,N] )<br />for i in xrange(len(A4)):<br /> imax = len(A4)-1<br /> if i == 0:<br /> #A4[i][i+1] = 36.<br /> #A4[i][i+2] =-24.<br /> #A4[i][i+3] = 28./3.<br /> #A4[i][i+4] =-1.5<br /> # new approach: set f''(\infty) = 0 = f''''(\infty)<br /> A4[i][i] = 0<br /> elif i == 1:<br /> A4[i][i ] = 16<br /> A4[i][i+1] =-9<br /> A4[i][i+2] = 8./3.<br /> A4[i][i+3] =-1./4.<br /> # scheme like Christopher simpson did<br /> #A4[i][i-1] =-4 # will be cut of ...<br /> #A4[i][i ] = 6<br /> #A4[i][i+1] =-4<br /> #A4[i][i+2] = 1<br /> elif i == 2:<br /> A4[i][i-2] = 0 # boundary condition: \phi_0 = 0<br /> A4[i][i-1] =-4<br /> A4[i][i ] = 6<br /> A4[i][i+1] =-4<br /> A4[i][i+2] = 1<br /> elif i >= 3 and i <= imax-3:<br /> A4[i][i-2] = 1<br /> A4[i][i-1] =-4<br /> A4[i][i ] = 6<br /> A4[i][i+1] =-4<br /> A4[i][i+2] = 1<br /> elif i == imax-2:<br /> A4[i][i-2] = 1<br /> A4[i][i-1] =-4<br /> A4[i][i ] = 6<br /> A4[i][i+1] =-4<br /> A4[i][i+2] = 0 # boundary condition: \phi_{i_\mathrm{max}} = 0<br /> elif i == imax-1:<br /> # see imax == 1<br /> A4[i][i ] = 16<br /> A4[i][i-1] =-9<br /> A4[i][i-2] = 8./3.<br /> A4[i][i-3] =-1./4.<br /> # scheme like Christopher simpson did ...<br /> #A4[i][i-2] = 1<br /> #A4[i][i-1] =-4<br /> #A4[i][i ] = 6<br /> #A4[i][i+1] =-4 # will be cut of ...<br /> elif i == imax:<br /> #A4[i][i-1] = 36.<br /> #A4[i][i-2] =-24.<br /> #A4[i][i-3] = 28./3.<br /> #A4[i][i-4] =-3./2.<br /> # new approach: set f''(\infty) = 0 = f''''(\infty)<br /> A4[i][i] = 0<br />\end{lstlisting}<br /><br />\end{document}maxiantorhttp://maxinator.bplaced.netnoreply@blogger.comtag:blogger.com,1999:blog-1308139960516080412.post-19390556604142144382015-07-26T16:17:16.825-05:002015-07-26T16:17:16.825-05:00\documentclass[12pt,a4paper]{article}
\usepackage[...\documentclass[12pt,a4paper]{article}<br />\usepackage[utf8]{inputenc}<br />\usepackage[german]{babel}<br />\usepackage[T1]{fontenc}<br />\usepackage{amsmath}<br />\usepackage{amsfonts}<br />\usepackage{amssymb}<br />\usepackage{listings}<br />\begin{document}<br /><br />Just some thoughts appearing after actually trying to implement this in python instead of just grasping the idea:<br /><br />You wrote: "At the boundaries, $\overline{\Phi}=0$, so the first and last columns of A and B are removed. However, $\overline{\Phi}=0$ also at the boundaries."<br /> -> I think you meant $\overline{\Phi}'(0,\infty)=0$ the second time (prime missing)<br /> <br />Some explicitly shown matrices, instead of only the general band structure, would have helped understanding a bit more. Especially with how the boundary conditions were applied. But this can be derived from your source code.<br /><br />I also wonder how you made this blog entry. Did you write this in latex? If so, which latex2html converter did you use?<br /><br /><br />\section{Boundary Conditions}<br /><br />You wrote: ''Fortunately, using a backward difference method at the boundary gives $\overline{\Phi}_{-1} \approx \overline{\Phi}_0$, so the $\overline{\Phi}_{i-2}$ term can be omitted from the $\overline{\Phi}''''$ approximation just inside the wall boundary. Similarly, the $\overline{\Phi}_{i+2}$ term can be omitted just inside the free-stream boundary.''<br /><br />About these boundary conditions I'm really really unsure about what was done and so on.<br />First: Saying that because of BDS $\Phi_{i-1} \approx \Phi_{i}$ and using that to eliminate $\Phi_{i-2}$ in $\Phi''''$ is wrong twice. First I would understand if you wrote: ''to eliminate $\Phi_{i-1}''$. Although I see, that BDS to an interval $2h$ instead of only $h$, thereby yielding $\Phi_0 \approx \Phi_{-2}$.<br />With this you could simplify<br />\begin{align}<br /> \Phi''''(0) = \frac{\Phi_{-2} -4 \Phi_{-1} + 6 \Phi_0 - 4\Phi_1 + \Phi_2}{h^4} + \mathcal{O}\left( h^2 \right) \\<br /> \overset{\text{Boundary}}{\Rightarrow}<br /> \Phi''''(0) = \frac{\Phi_{0} -4 \Phi_{-1} + 6 \Phi_0 - 4\Phi_1 + \Phi_2}{h^4} + \mathcal{O}\left( h^2 \right)<br />\end{align}<br />you seem to furthermore say that you can also eliminate $\Phi_{-1}\approx\Phi_0 = 0$ with this. Where $\Phi_0=$ because of the boundary condition. This would yield<br />\begin{align}<br /> \Phi''''(0) = \frac{- 4\Phi_1 + \Phi_2}{h^4} + \mathcal{O}\left( h^2 \right)<br />\end{align}<br />For the neighbouring point you seem to do something similar (looking at how you define A in your matlab sourecode).<br /><br />The problem with that approach is the error scaling! If you use BDS and plug it into the 4th derivative you get:<br />\begin{align}<br /> 0 = \Phi''(0) = \frac{\Phi_{0}-\Phi_{-2}}{2 h} + \mathcal{O}(h) \\<br /> \Rightarrow<br /> \Phi''''(0) = \frac{ 2h \Phi''(0) + \Phi_{-2} -4 \Phi_{-1} + 6 \Phi_0 - 4\Phi_1 + \Phi_2}{h^4} + \mathcal{O}\left( h^2 \right) \\<br /> = \frac{ \Phi_{0}-\Phi_{-2} + \mathcal{O}\left( h^2 \right) + \Phi_{-2} -4 \Phi_{-1} + 6 \Phi_0 - 4\Phi_1 + \Phi_2}{h^4} + \mathcal{O}\left( h^2 \right) \\<br /> = \frac{ -4 \Phi_{-1} + 6 \Phi_0 - 4\Phi_1 + \Phi_2}{h^4}<br /> \mathcal{O}\left( \frac{1}{h^2} \right)<br /> + \mathcal{O}\left( h^2 \right) <br />\end{align}<br />Note the error scaling which is actually 1 over h squared !!!. So in order to somehow use the boundary condition $\Phi'(0)=0$ to eliminate something you would have to use a BDS or CDS scheme with error scaling $\mathcal{O}\left( h^5 \right)$. This would look like:<br />\begin{align}<br /> f''''(0) = \frac{2 f_{-1} -9 f_0 + 16f_1 -14 f_2 + 6 f_3 - f_4 }{h^4} + \mathcal{O}\left(h^2\right) \\<br /> f''(0) = \frac{ -\frac{1}{5} f_{-1} -\frac{13}{12} f_0 + 2 f_1 - f_2 + \frac{1}{3} f_3 - \frac{1}{20} f_4 }{h} + \mathcal{O}\left(h^5\right) \\<br /> \label{eq:f4leftboundary}<br /> f''''(0) + \frac{10}{h^3} f''(0) \overset{f_0=0}{=}<br /> \frac{ 36 f_{1} - 24 f_2 + \frac{28}{3} f_3 - \frac{3}{2} f_4 }{h^4} + \mathcal{O}\left(h^5\right) \\<br />\end{align}maxiantorhttp://maxinator.bplaced.netnoreply@blogger.comtag:blogger.com,1999:blog-1308139960516080412.post-48805033202138241312015-07-24T18:17:16.523-05:002015-07-24T18:17:16.523-05:00Very interesting blog. Thank you for this entry, s...Very interesting blog. Thank you for this entry, saved me quite some time. The derivations and explanations are easy to follow.maxiantorhttp://maxinator.bplaced.netnoreply@blogger.com