CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums

Blog Entries

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

Old

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:
Code:
internalField  #codeStream
{
    code
    #{
        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 808 Comments 1 Hisham is offline Edit Tags

All times are GMT -4. The time now is 03:22.