|
[Sponsors] |
![]() |
![]() |
#1 |
Member
Daniel
Join Date: May 2018
Posts: 43
Rep Power: 8 ![]() |
Hello everybody,
for a new hybrid turbulence model I want to implement I need the dimensions of each cell to calculate a new delta. I found a way of calculating the dimensions in each direction (x, y, z) in meter. See code attached: Code:
const faceList & ff = this->mesh().faces(); const pointField & pp = this->mesh().points(); volScalarField deltax = this->y_; volScalarField deltay = this->y_; volScalarField deltaz = this->y_; forAll(this->mesh().C(), celli) { const cell & cc = this->mesh().cells()[celli]; labelList pLabels(cc.labels(ff)); pointField pLocal(pLabels.size(), vector::zero); forAll(pLabels, pointi) { pLocal[pointi] = pp[pLabels[pointi]]; } dimensionedScalar Convert ("Convert", dimensionSet(0, 1, 0, 0, 0, 0, 0), scalar(1)); deltax = (Foam::max(pLocal & vector(1,0,0)) - Foam::min(pLocal & vector(1,0,0))) * Convert; deltay = (Foam::max(pLocal & vector(0,1,0)) - Foam::min(pLocal & vector(0,1,0))) * Convert; deltaz = (Foam::max(pLocal & vector(0,0,1)) - Foam::min(pLocal & vector(0,0,1))) * Convert; } But my question is: Is there a more effective way of computing the cell dimensions in x, y and z than using a forAll loop? I have the impression that this is rather time-consuming when using a large mesh. Many thanks for your help! Daniel |
|
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[ICEM] Problem with prism cells | sidharath | ANSYS Meshing & Geometry | 0 | September 1, 2015 07:09 |
Accessing neighboring cells' cell number | Daniel Lattin | Siemens | 4 | October 20, 2006 16:19 |
physical boundary error!! | kris | Siemens | 2 | August 3, 2005 00:32 |
Accessing neighbouring cells in UDF | Hiranya Nath | FLUENT | 5 | March 22, 2002 23:29 |
Accessing neighboring cells in UDF | Christian | FLUENT | 1 | January 18, 2002 22:06 |