VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 05:08:27 05/16/04 Sun
Author: Ashkan Rasouli
Subject: Re: grid generation
In reply to: Arastoo Beheshti 's message, "grid generation" on 09:05:02 05/15/04 Sat

>for generating the grid for project #2,
>may there are many ways to impliment the boundry
>conditins and alternating conditions.
>if you want to use the goust cells for your
>project,just do these modification to your code.
>instead of Ni,Nj ,use Ni+2 & Nj+2,which "2" is the
>goust cells for boundry conditions in the former and
>alternating conditions for the latter.
>
>in order to use Formula 4 &11(in the last pages of the
>Proj.#2 for grid generation) ,just convert i to i-1
>and so on j to j-1 but denominators (Ni or Nj) remain
>unchanged.
>with a loop ,you can easily generate the grid ,by
>considering the goust cells.

That's a good idea Arastoo, but do not forget these points:
1)If you are using stretching grid, i.e.
rBar=((i-1)/(Nx-1))^P
beware when the stretching factor is 2.0 or 0.5 you will have the problem of having a positive rBar for the internal ghoast cell, or calculating the square root of a negative number!!
so for rBar at i=0 (Internal Ghoast Cell) do as follows:
if(i==0 && rBar>0)
rBar=-rBar;


2) If you have defined i&Nx as integers, (i-1)/(Nx-1) leads to an integer number, thus the interior zone will not be generated completely. In C/C++ you can simply use the following convertions:
rBar=(i-1)*1.0/(Nx-1); (the coefficient 1.0 ensures dividing a real number by the inetegr (Nx-1).

[ Next Thread | Previous Thread | Next Message | Previous Message ]

Post a message:
This forum requires an account to post.
[ Create Account ]
[ Login ]
[ Contact Forum Admin ]


Forum timezone: GMT-8
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.