CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Initialize a volScalarFiedl with wordList of patch types (http://www.cfd-online.com/Forums/openfoam-programming-development/84819-initialize-volscalarfiedl-wordlist-patch-types.html)

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:

GeometricField
(
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
(
IOobject
(
"skewness",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(0,0,0,0,0,0,0), 0.0),
typeList
);

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

Regards,

Thijs


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