local courant number
I would like to find out what is the local courant number in my computational domain.
The CoNum calculated by supported functions uses the surface scalar field phi, calculates the value for each face and outputs the max and mean value.
My idea was in general:
- create volScalarField vsfCoNum and use it as output
- in each time step:
- - calculate surfaceScalarField surfCoNum
- - for each cell in vsfCoNum
- - - find cell`s faces
- - - assign max value of surfCoNum of those found faces to vsfCoNum
I tried to implement it like this:
const volScalarField &vsfCoNum,
const fvMesh &mesh,
const Time &runTime,
const surfaceScalarField &phi
surfaceScalarField SfUfbyDelta =
surfaceScalarField CoNumSurfField (
(SfUfbyDelta/mesh.magSf()) * runTime.deltaT().value()
vsfCoNum[cell] = (...)
Unfortunately the assigment CoNum[cell] = (...) announces that this is "assignment for read only location". The same was with CoNum.internalField()[cell] = (...).
I know that there is some easy way to set the value at certain cell but I simply have problem with finding it.
Could you Foamers help me?
Are you able to calculate Local Courant no? If so can you post the code?
I also want to do the same.
Unfortunately I cannot find the code… Since some time I did not touch OF directly, and my data are a bit in a mess…
But I am sure that I finally managed to use the idea that I described almost a year ago.
The problem was to get to the data that you need, that is while having a cell number, find the faces that are “building “ that cell. But after some attempts it was possible. The code from last year points to some invalid data, you have to find another way to get the faces corresponding to a cell.
Thanks for the reply.
I will work on it.
|All times are GMT -4. The time now is 13:46.|