CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

2nd order boundary conditions for 2nd order discretization?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 24, 2011, 18:23
Default
  #21
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,273
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
We are not going anywhere. It seems that you have made up your mind and no amount of *discussion* is going to change it.

Time is important thing, so I have to limit it to some point. I can not spend more than what i have so far into this discussion.

So believe in whatever you believe in. Good luck.
arjun is offline   Reply With Quote

Old   December 24, 2011, 18:37
Default
  #22
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
Too bad, I am sure we could have all benefitted from this, but the discussion speaks for itself, then. Just please do me one favor and answer my question in red: were you talkung about the convergence of your matrix invert all the time? That would explain all the trouble ....

Cheers friend!
cfdnewbie is offline   Reply With Quote

Old   December 24, 2011, 19:58
Default
  #23
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,273
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by cfdnewbie View Post
were you talkung about the convergence of your matrix invert all the time? That would explain all the trouble ....

Nope.

I was talking about the fact that chosing a first order BC would not render the solution to 1st order everywhere. Saying it will is plain wrong.

So in the end, if you like to believe otherwise, then go ahead and do it. I certainly do not agree with it.
arjun is offline   Reply With Quote

Old   December 24, 2011, 20:06
Default
  #24
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
Quote:
Originally Posted by arjun View Post
Nope.

I was talking about the fact that chosing a first order BC would not render the solution to 1st order everywhere. Saying it will is plain wrong.

So in the end, if you like to believe otherwise, then go ahead and do it. I certainly do not agree with it.
No, I don't believe that, but it seems you insist. I rest my case here, since the concept of an integral norm does not seem to resonate with you, friend.

Good luck in your further CFD career, all the best!

Cheers!
cfdnewbie is offline   Reply With Quote

Old   December 24, 2011, 20:09
Default
  #25
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,273
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by cfdnewbie View Post
No, I don't believe that, but it seems you insist.
Here you go, good luck to you too.


Quote:
Originally Posted by cfdnewbie View Post
YThe overall solution will fall back to the lowest order in your domain, i.e. the boundary contribution.
cfdnewbie likes this.
arjun is offline   Reply With Quote

Old   December 24, 2011, 20:25
Default
  #26
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
You just wont let it go, will you? The keyword here is overall, not local. As I have written above, integral. But I can tell that your background is more on the practical than on the theoretical side, so I will not bother you further with mathematical concepts.
cfdnewbie is offline   Reply With Quote

Old   December 25, 2011, 03:31
Default
  #27
Senior Member
 
duri
Join Date: May 2010
Posts: 245
Rep Power: 16
duri is on a distinguished road
Quote:
Originally Posted by cfdnewbie View Post
.

I beg to differ. A first order cylinder BC will produce spurious entropy at each kink, thereby generating a entropy wake behind the object, and destroy e.g. symmetry. NS on the other hand usually dampens this effect, and is it less pronounced.

Cheers!
Here i not taking about internal boundaries like symmetry, periodic, sliding etc. Because you have sufficient data for higher order reconstruction. First order is sufficient enough at boundaries where user provides input eg., inlet, outlet etc.

Quote:
Originally Posted by cfdnewbie View Post
.

Order of accuracy is a mathematical concept, derived from a Taylor series, which is only valid for h->0. If you have a code at hand, try doing a convergence test, starting from a coarse grid. You will see that for a large h, you won't get any order of convergence at all.

I disagree, please see my post above, as Taylor series is only valid for h->0.
Cheers!
I don't understand why you worry so much about h->0, this concept is from calculus to handle derivatives at a point. (remember point is hypothetical concept).

Quote:
Originally Posted by cfdnewbie View Post
.
I agree. Try 16th order, and you will be done with one cell
Cheers!
You could laugh at it but i don't bother. When you are solving with some function that could capture the flow physics then you need only one cell (which means your function is analytical solution). In higher order scheme we use to reconstruct based on polynomial or exponential assumptions which may not agree with flow physics. So as approximation, assume that reconstruction is valid in neighborhood and try to fit it locally. Grossly one can say CFD is a kind of highly sophisticated piecewise curve fit in 3D domain.

To demonstrate the concept of h-method and p-method i am attaching two results. Both case ran in fluent, first with 4800 cells and second order Roe scheme (ramp_2nd.jpg) and other case with first order on same mesh but adapted whole region twice so that grid spacing is 4times smaller (ramp_1st.jpg). Check the results, it demonstrates the relation between accuracy, order and mesh size. Beware that even though accuracy of the results are almost same the order is different. Any interesting observations are welcomed.


Quote:
Originally Posted by cfdnewbie View Post
.
Shocks can indeed by captured in a cell, given that the subcell resolution is high enough. I can e.g. capture a shock in a Burger's equation in 1 pseudospectral cell!
Cheers!
This is very interesting. Can you give some reference on " capture a shock in a Burger's equation in 1 pseudospectral cell! "

Quote:
Originally Posted by cfdnewbie View Post
.
Maybe I didn't make this point clear enough. Of course, the cells away from the shock will keep their second order quality, but the WHOLE solution will be less than second order. Do a convergence test with a shock in it, the shock itself is not sufficiently smooth, thus all codes will lose their order of convergence and fall back down to first order.

All I'm saying is that the overall behavior of your solution is governed by the lowest-order phenomenon - it doesn't matter if that comes from physics or numerics.

Cheers!
I agree with this point, by introducing some lower order will pull the order of solution to some extent. Second order TVD schemes usually have order less than 2 and at worst case it could be close to 1. But accuracy of TVD is better than the pure second order solution. I emphasize on the solution accuracy than the theoretical order of accuracy.
Attached Images
File Type: jpg ramp_1st.jpg (45.6 KB, 12 views)
File Type: jpg ramp_2nd.jpg (46.7 KB, 11 views)
duri is offline   Reply With Quote

Old   December 25, 2011, 07:12
Wink
  #28
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
Hi duri,
thanks for your great reply!

Quote:
Originally Posted by duri View Post
Here i not taking about internal boundaries like symmetry, periodic, sliding etc. Because you have sufficient data for higher order reconstruction. First order is sufficient enough at boundaries where user provides input eg., inlet, outlet etc.
I tend to agree for simple flows, where the inlet and outlet are far away from the zone of action, so to speak. But let's take for example a shock - turbulence interaction, where a fully turbulent field is used as an inflow (this field is usually generated from previous turbulence simulations). In that case, the inflow order is highly important.


But in general, it fully depends on the flow physics and the size of your domain whether low order inflow is acceptable or not. It's the engineer's or scientist's job to make sure that your bcs do not (greatly) affect the outcome of your solution.



I don't understand why you worry so much about h->0, this concept is from calculus to handle derivatives at a point. (remember point is hypothetical concept).


Quote:
You could laugh at it but i don't bother. When you are solving with some function that could capture the flow physics then you need only one cell (which means your function is analytical solution). In higher order scheme we use to reconstruct based on polynomial or exponential assumptions which may not agree with flow physics. So as approximation, assume that reconstruction is valid in neighborhood and try to fit it locally. Grossly one can say CFD is a kind of highly sophisticated piecewise curve fit in 3D domain.
Why should I laugh at it? I fully agree with you. Just a note: the reconstruction you are talking about is only valid for Finite Volume formulations, I assume? Other approaches with subcell resolution don't require any reconstruction technique, they just approximate the solution inside each cell as a polynomial of arbitrary order.

Quote:
To demonstrate the concept of h-method and p-method i am attaching two results. Both case ran in fluent, first with 4800 cells and second order Roe scheme (ramp_2nd.jpg) and other case with first order on same mesh but adapted whole region twice so that grid spacing is 4times smaller (ramp_1st.jpg). Check the results, it demonstrates the relation between accuracy, order and mesh size. Beware that even though accuracy of the results are almost same the order is different. Any interesting observations are welcomed.
Thank you for the illustration, I agree with you.


Quote:
This is very interesting. Can you give some reference on " capture a shock in a Burger's equation in 1 pseudospectral cell! "
Please PM me about that, I'm on Christmas holidays, so I don't have access to all my codes and data. I'll be happy to send you references and the code after the break!
Here are two I can remember of the top of my head:
http://www.sciencedirect.com/science...21999182900699
http://www.sciencedirect.com/science...96300305003620


Quote:
I agree with this point, by introducing some lower order will pull the order of solution to some extent. Second order TVD schemes usually have order less than 2 and at worst case it could be close to 1. But accuracy of TVD is better than the pure second order solution. I emphasize on the solution accuracy than the theoretical order of accuracy.

Thank you so much, I was almost giving up on this forum

Have a nice time!
Cheers
cfdnewbie is offline   Reply With Quote

Old   December 25, 2011, 19:36
Default
  #29
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,273
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by cfdnewbie View Post
You just wont let it go, will you?
That is because that is what I was responding to, when i first commented. There is no doubt in anyone's mind that order of BC could affect the solution.

Quote:
Originally Posted by cfdnewbie View Post
The keyword here is overall, not local. As I have written above, integral. But I can tell that your background is more on the practical than on the theoretical side, so I will not bother you further with mathematical concepts.

I ran a LES simulation with say 10 million points. So how are you calculating the Taylor series expansion using 10 million points and get order of polynomial overall.

Are you doing a curve fitting for a polynomial using 10 million points and then saying that since I used 1st order BC this polynomial is first order because of BC.


Quote:
Originally Posted by duri View Post
Grossly one can say CFD is a kind of highly sophisticated piecewise curve fit in 3D domain.
Exactly. This sums up very well.
arjun is offline   Reply With Quote

Old   December 26, 2011, 07:08
Default
  #30
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
Quote:
Originally Posted by arjun View Post

I ran a LES simulation with say 10 million points. So how are you calculating the Taylor series expansion using 10 million points and get order of polynomial overall.

We are talking about the order of the scheme, not of the solution here, that's two very different things. I will walk you through how the process is done in code verification, see e.g. the report by the Sandia labs:
http://prod.sandia.gov/techlib/acces...000/001444.pdf

1) Generate an analytical solution to the NS-equations
2) Create a source term as a right hand side

(steps 1 and 2 are just to make sure that you have an exact solution for sth as complex as the NS equations).

3) Add the source term into your code, and doing your calculations
4) Let's say your exact solution is steady, but works with unsteady as well
5) For your steady state, compute the error of your numerical solution against the exact solution, in any suitable norm, let's say L2 for the WHOLE domain.
6) Decrease mesh spacing and repeat
7) compute order from E=Ch**p

Let's go back to step 5: Let's say your code is of order 2, so all your errors will go as h**2, so integrating over the whole domain will still give you an "squared" behavior.

Let's now assume that a single cell goes with h**1, because of whatever error is there. Then, the whole process with not give you p=2, but will go to p=1, as the linear error dominates.


I have attached a zip file with an excel sheet for you to test, I have set up a case with 100 O(2) cells and just a sinle O(1) cell, the overall error is O(1), as you can see.


This whole process is of course harder to do if you are doing an LES, but the concept is still valid.

Hope this clarifies things!
Cheers
Attached Files
File Type: zip conv.zip (11.8 KB, 1 views)
cfdnewbie is offline   Reply With Quote

Old   December 26, 2011, 07:12
Default
  #31
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
Quote:
Originally Posted by duri View Post
Grossly one can say CFD is a kind of highly sophisticated piecewise curve fit in 3D domain.
I do not mean to nitpick here, but it does not necessarily have to be piecewise, think of global methods. Also, curve fit sounds like "interpolation" to me, which is also not the only way to do it, but maybe I'm just misinterpreting your use of the word "curve fit"
cfdnewbie is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Implementation of boundary conditions for FVM Tom Main CFD Forum 7 August 26, 2014 05:58
2nd order upwind vs 2nd order upwind!!! Far Main CFD Forum 7 March 14, 2013 12:29
Water subcooled boiling Attesz CFX 7 January 5, 2013 03:32
divide a face in order to have different boundary conditions antonio ANSYS Meshing & Geometry 3 June 7, 2010 05:37
Boundary conditions? Tom Main CFD Forum 0 November 5, 2002 01:54


All times are GMT -4. The time now is 15:23.