I have just started developing my first grids for CFD applications; it is my first experience in Fortran and CFD. I would like to ask for help in finding a method to control the point spacing for the viscous grid around a 2D airfoil. I already implemented sinusoidal distribution, but I'm looking for something that allows me to specify the exact distance for the initial points and the total number of points around the surface.
Re: grid generation
I am sure there are other methods, but...
In my case, I use exponential distributions for grid spacing. This results in a function of the type:
ds = f (eta, beta)
where eta is the current grid level (i.e. you are generating a line of grid points from eta = 0 to eta_max, with spacing of d_eta = 1.0 for each level), and ds is the distance from the first point (eta = 0). The constant beta is used to determine the grid clustering strength (i.e., beta must be > 1.0, but the closer to 1.0, the higher the clustering).
This is an algebraic equation, and can be solved implicitly for the clustering parameter beta (i.e., set ds to the desired spacing at the first point and eta = 1.0 for the first point, solve implicitly for beta). I use Brent's algorithm (listed in Numerical Recipes) for this purpose.
You should be able to use a similar concept for other clustering functions, although if there's more than one clustering parameter (e.g. beta1, beta2, ...) it may be more difficult... Maybe some kind of iterative procedure could be implemented (solving for each clustering parameter successively).
Finally, if you do not care about an exact solution and just want to make the clustering distance equal to or less than a desired minimum (i.e., ds <= 0.1 / sqrt (Re) or something similar), the simplest method would be to pick an initial clustering parameter, and iterate the grid generation process, reducing the clustering parameter by a specified factor (e.g. 0.5) each time until the spacing requirements are satisfied.
Hope this helps.
Re: grid generation
Thank you very much for your help, It seems to be what I need, just need to implement it now!
|All times are GMT -4. The time now is 18:39.|