|March 7, 2011, 10:48||
Access cell volume from boundry condition
Join Date: Dec 2010
Posts: 60Rep Power: 8
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
|March 7, 2011, 12:33||
Join Date: Mar 2009
Posts: 91Rep Power: 9
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]];
|Thread||Thread Starter||Forum||Replies||Last Post|
|FvMatrix coefficients||shrina||OpenFOAM Running, Solving & CFD||10||October 3, 2013 14:38|
|how to access each cell of a face? (user fortran)||Katariina||CFX||3||January 28, 2008 10:16|
|wall boundry condition||fred||FLUENT||0||August 19, 2004 12:10|
|calculate cell volume, center...?||Paul||Main CFD Forum||5||June 21, 2003 12:55|
|How to caculate cell volume||Tareq Al-shaalan||Main CFD Forum||2||November 4, 2002 09:48|