# compute courant number for 3D geometry

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

 September 25, 2012, 06:44 compute courant number for 3D geometry #1 New Member   saeid oqaz Join Date: Feb 2012 Posts: 19 Rep Power: 5 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?

 September 25, 2012, 08:57 #2 Member   Meindert de Groot Join Date: Jun 2012 Location: Netherlands Posts: 34 Rep Power: 5 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.

 September 25, 2012, 13:37 #3 New Member   saeid oqaz Join Date: Feb 2012 Posts: 19 Rep Power: 5 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.

 September 25, 2012, 13:52 #4 Member   Meindert de Groot Join Date: Jun 2012 Location: Netherlands Posts: 34 Rep Power: 5 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.

 September 25, 2012, 14:54 #5 Member   Meindert de Groot Join Date: Jun 2012 Location: Netherlands Posts: 34 Rep Power: 5 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

 September 25, 2012, 16:55 #6 New Member   saeid oqaz Join Date: Feb 2012 Posts: 19 Rep Power: 5 hi Meindert youe explanation was perfect and help me alot. thanks very much.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post danny123 OpenFOAM 19 October 24, 2012 07:44 vandadt FLUENT 0 November 8, 2009 17:12 msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58 Kuba FLUENT 0 November 8, 2005 23:44 raintung FLUENT 3 May 7, 2003 06:03

All times are GMT -4. The time now is 09:52.