CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   volScalarField, initialization (

ubaid October 24, 2010 21:33

volScalarField, initialization
Hello Everybody,

I am struggling to initialize volScalarField with internalField and also with path values.

I found out following structure.

volScalarFial A
IOobject("A",runTime.timeName(),mesh,IOobject::NO_ READ,IOobject::NO_WRITE),
dimensionedScalar("A",A.dim, xyz)

I am not getting what is this xyz, I think its internal field.
and to initialize this field by its patch values i did following
A.boundaryField()[patchi] = 300;
in this way, 300 gets assigned to the whole boundary patches. when I write it in openfoam, then I get xyz in internal field and 300 at the patches, its right, BUT, when this field is used in a solver that is built in code, and this field is first of all initialized as above mentioned method then it does not give same results as I read in this Field inside the code.

I think there is a problem with internal field. Can anyone give me some suggestions?

What i want, is to initialize the fields in my code and want to use these fields inside the solver that is also built in my code, in order to save read and write time consumption.

Thanks in advance.

BEst Regards,

santiagomarquezd October 26, 2010 23:00

Hello ubaid!!

Can you post a more extense portion of your code? Maybe some includes are overwriting your hard-coded initialization.


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