On Wed, Aug 12, 2009 at 10:39 AM, Stephen Wornom <span dir="ltr"><<a href="mailto:stephen.wornom@sophia.inria.fr">stephen.wornom@sophia.inria.fr</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Matthew Knepley wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
1) You should really handle this by creating the constant vector on the pressure<br>
space and using MatNullSpaceCreate()<br>
<br>
2) You can also easily handle this by fixing the pressure at one point<br>
</blockquote></div>
At what indices or location does one fix the pressure? What value is it set. Usually pressure is part of the solution. It would seem to introduce an inconsistency.<br>
I would like to understand how to do it.</blockquote><div><br>It does not matter where you fix it or to what value. The absolute value of the pressure is not physically<br>relevant, only pressure differences (which is why only grad p appears). Fixing the pressure at any point<br>
to any value just sets the scale. There is no inconsistency. This is in many many elementary fluid mechanics<br>books.<br><br>To do this mechanically. Change one row in the operator div (from the div u = 0 equation) to the identity.<br>
<br> Matt<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Stephen<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Matt<div><div></div><div class="h5"><br>
<br>
On Wed, Aug 12, 2009 at 10:19 AM, William A. Perkins <<a href="mailto:william.perkins@pnl.gov" target="_blank">william.perkins@pnl.gov</a> <mailto:<a href="mailto:william.perkins@pnl.gov" target="_blank">william.perkins@pnl.gov</a>>> wrote:<br>
<br>
<br>
Stephen,<br>
<br>
There are two ways that I know of to deal with pressure checker<br>
boarding: staggered grids or some form of Rhie-Chow interpolation.<br>
IMO, these are simple only for uniform, Cartesian grids. For grids<br>
that are curvilinear, unstructured, non-uniform, and/or<br>
non-orthogonal, things get real complicated. There may be other<br>
methods, but something is required.<br>
<br>
Regarding boundary conditions, I would suggest this text book:<br>
<br>
H. K. Versteeg and W. Malalasekera. An Introduction to<br>
Computational Fluid Dynamics, the Finite Volume Method. 2nd<br>
edition. Prentice-Hall. 2007<br>
<br>
While this book uses the finite volume method, the explanation of<br>
boundary conditions and staggered grids is very good and relatively<br>
easy to interpret for finite difference. I would also recommend<br>
<br>
Joel H. Ferziger and Milovan Peric. Computational Methods for<br>
Fluid Dynamics. Springer-Verlag, 3rd edition, 2002.<br>
<br>
This is a little more general with regard to method discussing finite<br>
difference and finite volume, but still settling on finite volume.<br>
<br>
My $0.02: I question the use of finite difference. For Navier-Stokes,<br>
the use of finite volume is much more prevalent in commercial and<br>
research codes. If your student follows Versteeg and Malalasekera a<br>
simple, working, staggered grid FV code could be built in a very short<br>
time. If something more complicated is needed, it's probably<br>
explained in Ferziger and Peric.<br>
<br>
Also My $0.02: Unless the point of your student's work is to<br>
experience building her own code, why not download something like<br>
OpenFOAM (<a href="http://www.opencfd.co.uk/openfoam/" target="_blank">http://www.opencfd.co.uk/openfoam/</a>) and just use it? I<br>
expect the effort to learn something like OpenFOAM for a simple<br>
application will be much less than writing a new code.<br>
<br>
Hope this helps.<br>
<br>
Bill<br>
<br>
>>>>> "Stephen" == Stephen Wornom <<a href="mailto:stephen.wornom@sophia.inria.fr" target="_blank">stephen.wornom@sophia.inria.fr</a><br></div></div><div class="im">
<mailto:<a href="mailto:stephen.wornom@sophia.inria.fr" target="_blank">stephen.wornom@sophia.inria.fr</a>>> writes:<br>
<br>
Stephen> Shengyong wrote:<br>
>> Hi, Farshid<br>
>><br>
>> Maybe she should use the staggered grid method which is very<br>
simple to<br>
>> implement.<br>
Stephen> Does it remain simple for curvilinear meshes?<br>
Stephen> Stephen<br>
>><br>
>> On Tue, Aug 11, 2009 at 5:16 AM, Farshid Mossaiby<br>
<<a href="mailto:mossaiby@yahoo.com" target="_blank">mossaiby@yahoo.com</a> <mailto:<a href="mailto:mossaiby@yahoo.com" target="_blank">mossaiby@yahoo.com</a>><br></div><div><div></div><div class="h5">
>> <mailto:<a href="mailto:mossaiby@yahoo.com" target="_blank">mossaiby@yahoo.com</a> <mailto:<a href="mailto:mossaiby@yahoo.com" target="_blank">mossaiby@yahoo.com</a>>>> wrote:<br>
>><br>
>> Hi all,<br>
>><br>
>> Sorry for this off-topic post.<br>
>><br>
>> I am helping a master studnet which is working on solving<br>
>> Navier-Stokes equation with Finite Difference method. She is<br>
>> trying to eliminate spourious pressure modes from the solution.<br>
>> She needs to know some details that are not usually found in the<br>
>> papers but important when programming, e.g. boundary<br>
condition for<br>
>> pressure. If someone has expertise on this or know a *simple* FD<br>
>> code, I would be thankful to let me know.<br>
>><br>
>> Best regards,<br>
>> Farshid Mossaiby<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Pang Shengyong<br>
>> Solidification Simulation Lab,<br>
>> State Key Lab of Mould & Die Technology,<br>
>> Huazhong Univ. of Sci. & Tech. China<br>
<br>
<br>
--<br>
Bill Perkins<br>
Research Engineer<br>
Hydrology Group<br>
<br>
Pacific Northwest National Laboratory<br>
902 Battelle Boulevard<br>
P.O. Box 999, MSIN K9-36<br>
Richland, WA 99352 USA<br>
Tel: 509-372-6131<br>
Fax: 509-372-6089<br></div></div>
<a href="mailto:william.perkins@pnl.gov" target="_blank">william.perkins@pnl.gov</a> <mailto:<a href="mailto:william.perkins@pnl.gov" target="_blank">william.perkins@pnl.gov</a>><br>
<a href="http://www.pnl.gov" target="_blank">www.pnl.gov</a> <<a href="http://www.pnl.gov" target="_blank">http://www.pnl.gov</a>><div class="im"><br>
<br>
<br>
<br>
<br>
-- <br>
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
</div></blockquote>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>