Access cell volume from boundry condition
I'm struggling with a probably little problem. I want to access the volume of the first cell normal to a boundry from within the boundry condition.
For example like rho*CellVolume for mass of the first cell normal to a boundary.
Probably it's just one line of code, but I don't get, since I'm quite new to OpenFoam programming.
Thanks and greetings
The functionality isn't directly available (at least not in the older versions of OF). Maybe theres a better way in OF-1.6 or newer, but this should do the trick.
From with xxxFvPatchField<type>::someFunc()
const fvPatchScalarField& rhop = patch().lookupPatchField<volScalarField, scalar>("rho");
const scalarField& V = patch().boundaryMesh().mesh().V();
const unallocLabelList& faceCells = this->patch().faceCells();
rhoVp[faceI] = rhop[faceI]*V[faceCells[faceI]];
Thanks! It did the job.
|All times are GMT -4. The time now is 23:35.|