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

compute courant number for 3D geometry

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 25, 2012, 06:44
Default compute courant number for 3D geometry
  #1
New Member
 
saeid oqaz
Join Date: Feb 2012
Posts: 19
Rep Power: 5
saeid.oqaz is on a distinguished road
hi foamers.
i have 2 question about coutant number. in 3D geometry coutanr number calcualte as follows for any cell : ux.deltaT/deltax + uy.deltaT/deltay + uz.deltaT/deltaz
does openfoam calculate co number same this formula?
i read courantNo.H file and didnt understand about how calculate openfaom co number.

next question : in my case courant number very little (in order e-16). why?
saeid.oqaz is offline   Reply With Quote

Old   September 25, 2012, 08:57
Default
  #2
Member
 
Meindert de Groot
Join Date: Jun 2012
Location: Netherlands
Posts: 34
Rep Power: 5
meindert is on a distinguished road
Hi Saeid,

OpenFOAM does something very similar to your approach.

Code:
00037     scalarField sumPhi 
00038     ( 
00039         fvc::surfaceSum(mag(phi))().internalField() 
00040     ); 
00041  
00042     CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
My understanding of this piece of code is that for each cell it sums the face flux magnitudes, divides it by the cell volume and multiplies it with deltaT/2. The maximum over all cells is then the Courant number.
If you write it out, you will get exactly what you wrote in your post, with twice the amount of terms. I am not entirely sure about the factor 1/2, but my guess is that it has something to do with the fact that you get twice the amount terms.

I hope this helps.
meindert is offline   Reply With Quote

Old   September 25, 2012, 13:37
Default
  #3
New Member
 
saeid oqaz
Join Date: Feb 2012
Posts: 19
Rep Power: 5
saeid.oqaz is on a distinguished road
the code you say for openfoam 2.1 . i use openFOAM ext.1-6. and i work on incompressible flow. in directory src / finiteVolume / cfdTools / incompressible / CourantNo.H

code :

PHP Code:
33 scalar CoNum 0.0;
  
34 scalar meanCoNum 0.0;
  
35 scalar velMag 0.0;
  
36 
  37 
if (mesh.nInternalFaces())
  
38 {
  
39     surfaceScalarField magPhi mag(phi);
  
40 
  41     surfaceScalarField SfUfbyDelta 
=
  
42         mesh.surfaceInterpolation::deltaCoeffs()*magPhi;
  
43 
  44     CoNum 
max(SfUfbyDelta/mesh.magSf())
  
45         .value()*runTime.deltaT().value();
  
46 
  47     meanCoNum 
= (sum(SfUfbyDelta)/sum(mesh.magSf()))
  
48         .value()*runTime.deltaT().value();
  
49 
  50     velMag 
max(magPhi/mesh.magSf()).value();
  
51 }
  
52 
  53 Info
<< "Courant Number mean: " << meanCoNum
  54     
<< " max: " << CoNum
  55     
<< " velocity magnitude: " << velMag
  56     
<< endl
i dont understand openfaom how calculate co number. for example SfUfbyDelta how cumpute?

thanks for replying me.
saeid.oqaz is offline   Reply With Quote

Old   September 25, 2012, 13:52
Default
  #4
Member
 
Meindert de Groot
Join Date: Jun 2012
Location: Netherlands
Posts: 34
Rep Power: 5
meindert is on a distinguished road
I'm not familiar with that version of OpenFOAM, but the implementation is not very different actually. deltaCoeffs() returns 1/[distance between owner cell center and neighbour cell center]. I think you should be able to figure out the rest for yourself.
meindert is offline   Reply With Quote

Old   September 25, 2012, 14:54
Default
  #5
Member
 
Meindert de Groot
Join Date: Jun 2012
Location: Netherlands
Posts: 34
Rep Power: 5
meindert is on a distinguished road
I'm sorry, I was in a hurry. The implementation in OpenFOAM-1.6-ext is different. It finds the maximum over all faces and uses it to calculate the Courant number.

So this is what it does:
- calculate [face flux magnitude]/([distance from owner cell center to neighbour cell center]*[face area])
- take maximum over all faces and multiply the resulting value with deltaT
meindert is offline   Reply With Quote

Old   September 25, 2012, 16:55
Default
  #6
New Member
 
saeid oqaz
Join Date: Feb 2012
Posts: 19
Rep Power: 5
saeid.oqaz is on a distinguished road
hi Meindert

youe explanation was perfect and help me alot. thanks very much.
saeid.oqaz is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AMI speed performance danny123 OpenFOAM 19 October 24, 2012 07:44
Courant Number in unsteady problems... vandadt FLUENT 0 November 8, 2009 17:12
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Courant number calculation - unsteady flow Kuba FLUENT 0 November 8, 2005 23:44
On the Courant number . raintung FLUENT 3 May 7, 2003 06:03


All times are GMT -4. The time now is 19:25.