CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Conservation (https://www.cfd-online.com/Forums/main/130380-conservation.html)

Simbelmynė February 25, 2014 05:25

Conservation
 
Hi,

I have an incopressible code that produces correct results when compared to the literature for lid driven cavity flow.

I have a few questions though:

1. When I check the continuity equation it seems that it is quite far from zero, in the order of 1e-1 for the cavity flow case. Can a code produce correct results without continuity satisfied?

2. The code is transient and I am not really sure how to judge steady state conditions other than plotting the velocity in a few points. The time derivative is never zero even if the velocities do not change in the monitoring points.

3. With regards to 2. above I wonder if it is good to sum all velocities in all cells and subtract the result from a previous time-step result in order to find whether a steady state has occurred. It seems that I need to include the time-step here in some way as well since a small time-step should yield a smaller change in the flow field.

Any suggestions?

Thanks. =)

FMDenaro February 25, 2014 06:36

Quote:

Originally Posted by Simbelmynė (Post 476655)
Hi,

I have an incopressible code that produces correct results when compared to the literature for lid driven cavity flow.

I have a few questions though:

1. When I check the continuity equation it seems that it is quite far from zero, in the order of 1e-1 for the cavity flow case. Can a code produce correct results without continuity satisfied?

2. The code is transient and I am not really sure how to judge steady state conditions other than plotting the velocity in a few points. The time derivative is never zero even if the velocities do not change in the monitoring points.

3. With regards to 2. above I wonder if it is good to sum all velocities in all cells and subtract the result from a previous time-step result in order to find whether a steady state has occurred. It seems that I need to include the time-step here in some way as well since a small time-step should yield a smaller change in the flow field.

Any suggestions?

Thanks. =)


1) what about your numerical formulation? Are you using an exact or approximate projection method or something different?

2) steady state is when your time derivatives vanish in some norm. Practically, you can check for the max derivative in all the points and stop when its value (normalized) is under some threshold (for example 10^-4 or smaller)

3) see 2)

Simbelmynė February 25, 2014 07:26

Quote:

Originally Posted by FMDenaro (Post 476679)
1) what about your numerical formulation? Are you using an exact or approximate projection method or something different?

2) steady state is when your time derivatives vanish in some norm. Practically, you can check for the max derivative in all the points and stop when its value (normalized) is under some threshold (for example 10^-4 or smaller)

3) see 2)

Thanks for a quick reply.

1) I am not sure. I construct a Poisson equation for pressure, using the momentum equations and continuity equation, similar to the MAC formulation but without a staggered grid.

2) So I have tried the following:

abs(u_old-u_new)/u_old (this seems like something I would use to determine a relative residual in a pure steady-state formulation, usually I use a convergence criteria based on lowering the initial residual by 3-4 orders of magnitude)

(u_new-u_old)/delta_t (shouldn't this converge to zero in the steady-state limit for a transient formulation?)

None of the above seem to work. What type of norm do you suggest using?

FMDenaro February 25, 2014 07:44

MAC method require a second order discretization on staggered grid to ensure that the divergence-free constraint is satisfied up to machine precision. Differently, You have only an approximation of the order of the local truncation error.

Estimating max(unew-uold)/dt must work...

Simbelmynė February 25, 2014 08:30

2 Attachment(s)
Quote:

Originally Posted by FMDenaro (Post 476695)
MAC method require a second order discretization on staggered grid to ensure that the divergence-free constraint is satisfied up to machine precision. Differently, You have only an approximation of the order of the local truncation error.

Estimating max(unew-uold)/dt must work...


Ok I will check the criteria in my code once more.

May I ask again if it is possible to get correct results without correct conservation of mass? What I mean is that when I terminate the cavity flow calculation it is very close to the solution of Ghia et al, but the continuity equation is not satisfied very well.

FMDenaro February 25, 2014 15:01

as you can see, the continuity error seems localized at the corners, you can check the streamlines there and control what happens.
Generally, the error in the divergence of the velocity is a source term in the kinetic energy that can produce a numerical instability. But for steady laminar flows the error is quite controlled and results can be stable

Simbelmynė February 25, 2014 16:26

Quote:

Originally Posted by FMDenaro (Post 476779)
as you can see, the continuity error seems localized at the corners, you can check the streamlines there and control what happens.
Generally, the error in the divergence of the velocity is a source term in the kinetic energy that can produce a numerical instability. But for steady laminar flows the error is quite controlled and results can be stable

Yes I agree.

I have re-checked the code and now the residual du/dt converges to zero at steady-state. So now I do not need the extra monitoring points to judge whether steady-state has occurred =)

I think the main problem with the continuity is that I noticed that the poisson equation for pressure stalls quite quickly. If I iterate for 1 or 1000 iterations does not seem to matter the results will be the same. The time-step, however, helps in that it reduces the continuity error (lower time-step yields lower continuity error). I think I might have mis-formulated the poisson solver in some way (not severely enough to cause instability though). I'll see what I can come up with tomorrow.

Simbelmynė February 26, 2014 06:04

Update:

I have added a single Dirichlet pressure point on the otherwise all Neumann wall boundary and now the Pressure Poisson solver converges without stalling (now I see the importance of fulfilling the Scarborough criteria).

The current problem is that the time-step is still the most dominant factor in producing accurate results (lower yielding better results). This is confusing.


All times are GMT -4. The time now is 21:33.