CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Conservation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 25, 2014, 05:25
Default Conservation
  #1
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
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. =)
Simbelmynė is offline   Reply With Quote

Old   February 25, 2014, 06:36
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Simbelmynė View Post
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)
FMDenaro is offline   Reply With Quote

Old   February 25, 2014, 07:26
Default
  #3
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
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?
Simbelmynė is offline   Reply With Quote

Old   February 25, 2014, 07:44
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
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...
FMDenaro is offline   Reply With Quote

Old   February 25, 2014, 08:30
Default
  #5
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
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.
Attached Images
File Type: jpg cavityFlow.JPG (40.6 KB, 11 views)
File Type: jpg continuity.jpg (16.2 KB, 9 views)

Last edited by Simbelmynė; February 25, 2014 at 09:35. Reason: Added some files.
Simbelmynė is offline   Reply With Quote

Old   February 25, 2014, 15:01
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
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
FMDenaro is offline   Reply With Quote

Old   February 25, 2014, 16:26
Default
  #7
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
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ė is offline   Reply With Quote

Old   February 26, 2014, 06:04
Default
  #8
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 546
Rep Power: 15
Simbelmynė is on a distinguished road
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.
Simbelmynė is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does FEM satisfy conservation locally? Vino Main CFD Forum 0 January 23, 2014 14:14
How to call the subroutine to compute two temperature energy conservation equations? wangweizong Phoenics 1 March 21, 2012 09:27
lost of mass conservation jjchristophe FLUENT 0 June 18, 2010 05:44
Conservation target in transient simulations Target CFX 12 September 25, 2006 07:20
Mass conservation Diego Nogueira Main CFD Forum 1 July 30, 2004 15:50


All times are GMT -4. The time now is 06:23.