CFD Online Logo CFD Online URL
Home > Forums

Blog Entries

Register Blogs Members List Search Today's Posts Mark Forums Read


Set (Initial) Internal Fields Using #codeStream

Posted April 23, 2012 at 13:55 by Hisham (Notes for OpenFOAM!)

To set up (initial) internal fields of variables according to an expression, one can use the #codeStream feature as:
internalField  #codeStream
        const IOdictionary& d = static_cast<const IOdictionary&>(dict);
        const fvMesh& mesh = refCast<const fvMesh>(d.db());
        scalarField fld(mesh.nCells(), 12.34);// uniform value of the field as 12.34 or just fld(mesh.nCells())
Hisham's Avatar
Senior Member
Posted in Uncategorized
Views 1341 Comments 1 Hisham is offline Edit Tags

All times are GMT -4. The time now is 12:05.