CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   2D Explicit CFD - dumb/frustrating question (https://www.cfd-online.com/Forums/main/10079-2d-explicit-cfd-dumb-frustrating-question.html)

Kevin October 13, 2005 11:53

2D Explicit CFD - dumb/frustrating question
 
Hi - first time posting on this forum.

I've been struggling for a while with coding the 2D driven lid cavity flow and have tried many approaches. I've gotten close many times, but the solution is not quite correct and has erratic behavior.

Right now I'm trying to do the following: *Collocated variables *10X10 equi-spaced Cartesian grid *Explicit Euler for time integration

I'm following Ferziger and Peric (3rd. ed). The procedure I'm trying to follow is on page 170: 1) Start w/ velocity field (divergence free) 2) Compute Hx,y (discretization of advective and viscous terms for x and y momentum equations) at cell centers 3) Solve Poisson equation for new pressure 4) Update velocity field

Since the variables are collocated, the form of the Poisson equation that I'm using is on page 199, equation 7.126. It is the inconsistent Poisson equation, with pressure differenced twice using central differencing, and Hx,y (from step 2) is interpolated on cell edges using the values at the cell centers (page 200, eq. 7.127), then central differenced.

My question is, how do you calculate the pressure and H on the boundary edges? Right now I'm just extrapolating to the edge using the neighboring derivative, but it doesn't work.

Any clarification or advice would be great. Thanks.

-Kevin


dragon October 14, 2005 02:25

Re: 2D Explicit CFD - dumb/frustrating question
 
hi, for 2d finite volume code and 2d cavity flow the H on the boundary edges are all known(since velocity is given there), you needn't extrapolate it at all. hope this helps

Kevin October 14, 2005 08:06

Thanks, dragon
 
Thank you for your response, dragon.

I don't know if I made it clear before, but I'm using a collocated grid, not a staggered one. The variables are located at the cell centers, not the vertices.

After more thought, I'm guessing that the interpolation of H must be done in some way so that when you add it to the pressure discretization is equivalent to the boundary condition for velocity (if one were to simply put the new velocities into the continuity equation).

For now I got my first code running by doing just that. The aim is to solve the Poisson equation. I'm using a modified Newton's method (I know, inefficient for now compared to just treating it as a linear problem). For each guess of Pressure, I'm explicitly updating the velocity, then computing the divergence of the velocity, and zeroing out the result (i.e., satisfying the continuity equation). The boundary conditions there are extrapolation of pressure from the interior cells, and velocity boundary conditions (driven-lid boundary conditions). The boundary condition for H is side-stepped in this way.

Thanks again, Kevin


dragon October 15, 2005 05:35

Re: 2D Explicit CFD - dumb/frustrating question
 
I see it is a colocated grid but in the pressure equation,H appears in a divergence operator,when discretized with the finite volume method, the volume integral of dHi/dXi can be transformed into the boundary surface integral. Thus you need not interpolate it at all ,just use the value in the boundary surface(Line) is enough.


All times are GMT -4. The time now is 03:27.