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><br> Matt<br><br>
<div class="gmail_quote">On Wed, Aug 12, 2009 at 10:19 AM, William A. Perkins <span dir="ltr"><<a href="mailto:william.perkins@pnl.gov">william.perkins@pnl.gov</a>></span> wrote:<br><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>
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">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 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 <<a href="mailto:mossaiby@yahoo.com">mossaiby@yahoo.com</a><br>
>> <mailto:<a href="mailto:mossaiby@yahoo.com">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 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>
<a href="mailto:william.perkins@pnl.gov">william.perkins@pnl.gov</a><br>
<a href="http://www.pnl.gov" target="_blank">www.pnl.gov</a><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>