CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Oscillating drag coefficient

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 2 Post By Blanco

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 9, 2015, 19:37
Default Oscillating drag coefficient
  #1
New Member
 
Guilherme
Join Date: Nov 2013
Posts: 5
Rep Power: 9
gamma_user is on a distinguished road
Hello,

I am new to OpenFOAM and I am trying to simulate the supersonic flow of air (Mach 3) past a circular cone of semi-angle 10 degrees. When I plot the drag coefficient (Cd) as a function of the number of iterations, Cd seems to converge, but when I zoom in, some oscillation appears. How can I increase the precision of the calculation in order to reduce this oscillation? The main files are attached.

cone-50x50.zip

Cd.pdf

Cd2.pdf
gamma_user is offline   Reply With Quote

Old   February 10, 2015, 12:43
Default
  #2
Member
 
Thiago Parente Lima
Join Date: Sep 2011
Location: Diamantina, Brazil.
Posts: 54
Rep Power: 12
thiagopl is on a distinguished road
Notice that you write your results with writePrecision 6 and your oscillations are of 0.0001. Try to increase the writePrecision.

The oscillations are of 0.05%, do you need more than this?
thiagopl is offline   Reply With Quote

Old   February 10, 2015, 14:39
Default
  #3
New Member
 
Guilherme
Join Date: Nov 2013
Posts: 5
Rep Power: 9
gamma_user is on a distinguished road
Quote:
Originally Posted by thiagopl View Post
Notice that you write your results with writePrecision 6 and your oscillations are of 0.0001. Try to increase the writePrecision.

The oscillations are of 0.05%, do you need more than this?
I changed writePrecision from 6 to 12 and tolerance (fvSolution) from 1e-3 to 1e-9, but the solution is still the same. Indeed, I need a numerical solution with minimal iteration error in order to estimate its discretization error and its order of accuracy (verification procedure).

Cd2.pdf
gamma_user is offline   Reply With Quote

Old   February 11, 2015, 06:04
Default
  #4
Senior Member
 
Blanco
Join Date: Mar 2009
Location: Torino, Italy
Posts: 192
Rep Power: 14
Blanco is on a distinguished road
If you want to avoid precision-writing issues then it's better if you change your writeFormat to binary. I suggest also to change tolerance to something like 1e-16, if you really need to have this high precision in the results.
Try changing fvSchemes dict and use higher precision schemes.
But, again, as thiagopl said you are getting oscillations that are 0,05% the mean value...
Blanco is offline   Reply With Quote

Old   February 11, 2015, 08:10
Default
  #5
New Member
 
Guilherme
Join Date: Nov 2013
Posts: 5
Rep Power: 9
gamma_user is on a distinguished road
Quote:
Originally Posted by Blanco View Post
If you want to avoid precision-writing issues then it's better if you change your writeFormat to binary. I suggest also to change tolerance to something like 1e-16, if you really need to have this high precision in the results.
Try changing fvSchemes dict and use higher precision schemes.
But, again, as thiagopl said you are getting oscillations that are 0,05% the mean value...
I followed your instructions (except by the schemes) and increased the number of iterations, but the oscillations are still there...

Cd2.pdf

I agree that for some applications the precision of 0.05% is enough, but for verification, it is not.
gamma_user is offline   Reply With Quote

Old   February 11, 2015, 08:33
Default
  #6
Senior Member
 
Blanco
Join Date: Mar 2009
Location: Torino, Italy
Posts: 192
Rep Power: 14
Blanco is on a distinguished road
You'll never obtain a smooth horizontal line for your Cd, probably. This can be caused by different things: turbulence model (obviously), mesh quality, mesh resolution, approximation used to model the problem, etc.

You said you are doing a verification test, therefore your goal is to compare CFD results with analytic results coming from some equation, on a very simple geometry I guess. For the reference, how far is your CFD result from the analytic result? Moreover, are you monitoring only the Cd value? Please consider that this is a "global" value, I would suggest to consider the pressure distribution along the geometry, or some local variable, to do a verification of a model implementation in the CFD code.

We have also to remember that sometimes we are modeling things as "stady-state" but this is only an approximation (i.e. turbulence is never a steady state phenomenon). That's why we judge converge of the sim by looking at some important overall value, waiting until it is "smooth enough", were this "enough" has be decided (considered with care) by the analyst.

Regards
Blanco is offline   Reply With Quote

Old   February 11, 2015, 08:36
Default
  #7
Senior Member
 
Blanco
Join Date: Mar 2009
Location: Torino, Italy
Posts: 192
Rep Power: 14
Blanco is on a distinguished road
Quote:
Originally Posted by gamma_user View Post
...

I agree that for some applications the precision of 0.05% is enough, but for verification, it is not.
Well, 0,05% can be accepted or not for a verification case, you're the one that have to decide in this case.

As a reference...I think NASA people would accept 0,05% error in a verification case, look here

HTML Code:
http://turbmodels.larc.nasa.gov/flatplate_w06.html
Blanco is offline   Reply With Quote

Old   February 11, 2015, 15:26
Default
  #8
New Member
 
Guilherme
Join Date: Nov 2013
Posts: 5
Rep Power: 9
gamma_user is on a distinguished road
Hello, Andreas and Thiago,

I appreciate your help very much, but my problem is not solved yet.

I believe I am not using a turbulence model. I set "simulationType laminar;" in the turbulenceProperties dictionary. Is it right?
The only reason I am using the turbulence dictionary is that the calculation of the drag coefficient depends on that (I could not remove this dictionary).

Anyway, I think the iteration error should reduce to the machine precision as the number of iterations increase, independently of the mesh, as can be seen in the following paper (figure 7):
* Roy, C.; McWherter-Payne, M. & Oberkampf, W. Verification and validation for laminar hypersonic flowfields, part 1: Verification AIAA Journal, {2003}, {41}, {1934-1943}

The iteration error at the n-th iteration is defined as
E_n = phi_n-phi_inf,
where phi_n is the numerical solution at the n-th iteration and phi_inf is the exact solution to the linear system.

Is there any other suggestion about this question? What kind of scheme should I use?
gamma_user is offline   Reply With Quote

Old   February 11, 2015, 17:31
Default
  #9
Senior Member
 
Blanco
Join Date: Mar 2009
Location: Torino, Italy
Posts: 192
Rep Power: 14
Blanco is on a distinguished road
Hi,

I've given a look at the reference you cited and I've noticed, as expected, that local flow variables are considered to calculate iterative convergence error, not a global variable like Cd. This because a global variable can't tell you all you need to know to assure that your code is validated. So again, I suggest you to move to local variables if you are interested in a verification of your code (which, for reference, require to compute numerical error and not just iterative convergence error. You'll have to work also on grid error and grid refinements, my previous suggestion related to the grid was done while supposing that you were looking at the numerical error).

The only figure which is referred to cd is figure 9, but you can see that 400k iterations are needed in that case to reach 1e-12% iterative convergence error, in the best case, on the finer grid! Therefore if you would like to reach this kind of iterative convergence error I warmly suggest you to use high order precision schemes for your fvSchemes dict and prepare for a long sim. Please, consider the detail of the solver you are using (segregated?) and search in the fvschemes the best one that can help you in speeding up the convergence rate.

Btw, have you tried to compute your actual iterative convergence error? I would suggest you to try to evaluate it using eq.s 5 and 6 and NOT considering the exact solution of the analytic model...this because you are using a grid for your sim, therefore you will have a discretization error affecting your results, but you don't know how much it is and you don't want to mix the discretization error with the iterative convergence error. Using eq 5 and 6 you are indirectly computing the "exact" solution and the error from the last 3 results in the iterative scheme, therefore the discretization error is transparent in this case and you'll obtain only the iterative convergence error. Moreover, what is the magnitude of the residuals that you have reached? Are the tolerances low enough to keep the solver iterating in each time step (so no 0 iterations are obtained)?

Best
thiagopl and elmo555 like this.
Blanco is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
wrong SU2 calculation for lift and drag coefficient for NAC4421 mechy SU2 7 January 9, 2017 05:18
how to calculate drag force coefficient of cylinder in oscillating flow vhcongtltd FLUENT 10 September 25, 2014 04:59
Calculation of Drag Coefficient, Help Please teek22 CFX 1 April 26, 2012 18:41
Automotive test case vinz OpenFOAM Running, Solving & CFD 98 October 27, 2008 08:43
Drag coefficient Oscillating plate Anant Main CFD Forum 0 September 6, 2001 10:31


All times are GMT -4. The time now is 04:12.