CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Initialize a volScalarFiedl with wordList of patch types (

tgillebaart February 9, 2011 09:34

Initialize a volScalarFiedl with wordList of patch types
Hi everyone,

Since a couple of months I'm using openfoam-1.5-dev for my master thesis. At this moment I'm working on a utility to write out the skewness and nonOrthogonality fields of the complete mesh. This also includes the face skewness and nonOrthogonality of the boundaries. When looking at the possible constructures of volScalarField (which is a "GeometricField<scalar, fvPatchField, volMesh>") there is the following possibility:

const IOobject & io,
const Mesh & mesh,
const dimensionSet & ds,
const wordList & patchFieldTypes

It looks like the last argument can be used to specifiy the patchTypes. For my output fields I would like to be able to assign a nonUniform list to each the patches independent of the types read from the mesh. However the type should be equal to "calculated", otherwise the assignment does not work. No error will be given during compilation or running but the field values for patches with e.g. symmetryPlane are not stated in the file.

When I give a wordList in the constructor with only calculated it does not assign it to the patches. I checked this by looking in the file, but also by printing out volScalarField.boundaryField().types() right after the constructor. Here the patch types have not changed. My constructor looks as follows:

volScalarField skewnessIO //Create IO field for absolute skewness
dimensionedScalar("zero", dimensionSet(0,0,0,0,0,0,0), 0.0),

Can anyone explain me what I'm doing wrong? Is the constructor with the wordList not meant for what I'm doing?



All times are GMT -4. The time now is 23:29.