|
[Sponsors] |
how to calculate courant number in unstructured grids. |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 23, 2016, 16:13 |
how to calculate courant number in unstructured grids.
|
#1 |
Member
a
Join Date: Oct 2014
Posts: 49
Rep Power: 12 |
Dear All,
I have developed a unstructured code in 3d, which is basically a implicit code, with SIMPLE algorithm. For accurate transient results, I want to track CFL condition, i.e max Co<1. Can any one help me how to use the face velocities (for the given cell say "P") and cell volume (V) to calculate local Courant number? here is the way OPENFOAM does it, but I am unable to decode it Code:
scalar CoNum = 0.0; scalar meanCoNum = 0.0; if (mesh.nInternalFaces()) { scalarField sumPhi ( fvc::surfaceSum(mag(phi))().internalField() ); CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); meanCoNum = 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue(); } Info<< "Courant Number mean: " << meanCoNum << " max: " << CoNum << endl; Thanks in advance! |
|
October 23, 2016, 16:20 |
|
#2 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73 |
||
October 23, 2016, 16:30 |
|
#3 |
Member
a
Join Date: Oct 2014
Posts: 49
Rep Power: 12 |
refer next reply
|
|
October 23, 2016, 16:41 |
|
#4 |
Member
a
Join Date: Oct 2014
Posts: 49
Rep Power: 12 |
Thanks FMDenaro for a quick and useful reply.
But It will be helpful, if you can elaborate on the following queries, Does it mean ----> surfaceSum(mag(phi))().internalField() = U*A ? (U is a vector) and also why 0.5 is multiplied to Co in openfoam implementation? Also I want to compute Courant number for generalised 3d unstructured (non-uniform) grid, the equation in the suggested blog is restricted to uniform grids --->"The above equation is strictly true only for homogeneous uniform hex-grids" It will be a great help, if someone can write a equation in terms of "summation of face velocities." |
|
October 24, 2016, 04:47 |
|
#5 |
Senior Member
|
Consider pages 175-176 in the following book:
https://books.google.it/books?id=r-e...ctured&f=false CFL is sigma in those equations. Not an OF expert here but, your excerpt seems to compute the CFL as 0.5 times the ratio between "sum of convective fluxes over faces of a cell" and "volume of the cell" (then, the max over all the cells is considered as final CFL... i think). Factors like 0.5 usually appear in such expressions, which are never actually exact (more often than not they are based on heuristics). It also depends on how such CFL is used. Here it seems that it is just used as a postprocessing step (and not to compute the actual time step to advance the simulation), so it should be relatively unimportant. I have much more doubts on how the mean CFL is computed, which looks total crap to me... but that's just a personal opinion. |
|
October 24, 2016, 04:52 |
|
#6 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73 |
My opinion is that the CFL parameter is not indipendent from the scheme... I mean, it must be defined by the non-dimensional group appearing in the discretization.
Therefore, for unstructured grid I would consider that equation as an approximation. |
|
October 24, 2016, 10:59 |
|
#7 |
Senior Member
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25 |
The velocity in the cell is a well-defined quantity in collocated schemes. The problem then becomes the definition of the length scale. For stability purposes, the best definition (IMO) of limiting length scale is the diameter of the largest sphere fitting within the cell. If your mesh doesn't change, you can compute and store that length scale at the start of the simulation and re-use it.
Definitions like what you've posted from OF fail to incorporate the skewness of the cell into the length-scale calculation. For stability, that sort of thing is very important. A hex cell that measures 1x1x0.001 is going to have a length scale of 0.1 (or 0.05?) based on the OF scheme. But for stability, that length scale is more appropriately 0.001. |
|
October 24, 2016, 12:16 |
|
#8 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73 |
I agree, the key is the correct definition of the lenght along which a fluid particle moves with its transport velocity. The general meaning of the Courant number is the ratio bewteen the exact trajectory slope and the discrete one defined by grid and discretization. For this reason, defining an arbitrary non-dimensional group is not correct in terms of stability constraint.
I have time, I will collect some of my previous notes on the stability analysis and I will post. |
|
October 24, 2016, 13:03 |
|
#9 |
Senior Member
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25 |
I am interested to read your thoughts on this. I view the embedded sphere diameter as a sufficient condition for stability, but perhaps not a necessary one. It seems that there should be a vector dependence in the stability calculation because intuitively, a 2d flow with dx = 1 and dy = 0.001 could have a dt ~ 1 if, say, u=1 and v=0 (or even 0.0001).
I looked briefly at computing stability based on an ellipsoid fully contained within each cell and then taking the length scale as the distance across that ellipsoid along the direction of velocity vector. I think that this is a valid approach, but the fitting of "optimal" ellipsoids inside cells was a geometry problem that I couldn't find time to tackle. I was considering an arbitrary ellipsoid with maximum volume fully contained within a unstructured cell. It becomes a problem of constrained optimization--making it eminently solvable but also a nuisance involving normal distance from planes to the ellipsoid and slack variables--ICK! Problems like that make me wish that I had grad students running around. 8) |
|
October 24, 2016, 13:27 |
|
#10 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73 |
Quote:
I am not sure about the constraint based on the sphere, perhaps also for the fact that a correct velocity component should be addressed. And, what is more, the stability depends on the non-dimensional group appearing in the scheme. I will try to make a brief note as soon as possible. |
||
October 24, 2016, 16:04 |
|
#11 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73 |
I just recollect a brief note developed for the simple triangular tesselation of a structured grid. I highlighted the role of the non-dimensional parameter but I did not specify the spatial discretization of integrals and derivatives.
You can see that the skweness of the cell is taken into account. After one specify the spatial discretization, the stability analysis can be performed by the Von Neumann method. |
|
October 28, 2016, 10:47 |
Coefficient of Torque
|
#12 |
Member
Radwanma
Join Date: Oct 2014
Posts: 30
Rep Power: 12 |
Hi All,
I am just wondering is this form ct = Turbine_Torque / (0.5*density*pi*R^3*wind_speed^2) correct to calculate the torque coefficient directly from FLUENT, PLEASE? Regards, |
|
October 28, 2016, 12:53 |
|
#13 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73 |
||
Tags |
implementation courant |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
decomposePar no field transfert | Jeanp | OpenFOAM Pre-Processing | 3 | June 18, 2022 13:01 |
simpleFoam parallel | AndrewMortimer | OpenFOAM Running, Solving & CFD | 12 | August 7, 2015 19:45 |
SigFpe when running ANY application in parallel | Pj. | OpenFOAM Running, Solving & CFD | 3 | April 23, 2015 15:53 |
foam-extend_3.1 decompose and pyfoam warning | shipman | OpenFOAM | 3 | July 24, 2014 09:14 |
Cluster ID's not contiguous in compute-nodes domain. ??? | Shogan | FLUENT | 1 | May 28, 2014 16:03 |