CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Modified pointVectorField.boundaryField is not written to output file

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By elmo555

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 17, 2018, 10:49
Default Modified pointVectorField.boundaryField is not written to output file
  #1
Member
 
Lennart
Join Date: Feb 2016
Posts: 46
Rep Power: 10
elmo555 is on a distinguished road
Dear foamers,

I'm trying to interpolate a surfaceVectorField to pointVectorField and then write it to a output file with the following code, but nothing gets written:
Code:
pointVectorField sensPointVec
(
    IOobject
    (
        "sensPointVec",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    pointMesh::New(mesh),
    dimensionedVector("(0,0,0)", dimless, vector::zero),
    "fixedValue"
);
Code:
            PrimitivePatchInterpolation<primitivePatch> patchInterpolator
            (
                mesh.boundaryMesh()[bi]
            );

            vectorField interpSensPointVec = patchInterpolator.faceToPointInterpolate(sensSurfaceVec.boundaryField()[bi]);
            Info << "interpSensPointVec " << interpSensPointVec << endl;
            sensPointVec.boundaryFieldRef()[bi] = interpSensPointVec;
The code compiles and runs and the new vectorField interpSensPointVec is filled with data (Info prints tons of data to the screen). But the output file sensPointVec contains just the initially set values and not the ones written into sensPointVec.boundaryFieldRef()[bi]:
Code:
boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    outlet
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
...
Any help is appreciated!
ancolli likes this.
elmo555 is offline   Reply With Quote

Old   January 18, 2018, 11:42
Default
  #2
Member
 
Lennart
Join Date: Feb 2016
Posts: 46
Rep Power: 10
elmo555 is on a distinguished road
I think I found the solution, you just need to replace the = in the assignment with ==

Code:
            sensPointVec.boundaryFieldRef()[bi] == interpSensPointVec;
An explanation for the difference between = and == in boundary condition assignment can be found in this thread.
elmo555 is offline   Reply With Quote

Reply

Tags
boundaryfield, output, pointvectorfield


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
polynomial BC srv537 OpenFOAM Pre-Processing 4 December 3, 2016 10:07
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 tlcoons OpenFOAM Installation 13 April 20, 2016 18:34
what is swap4foam ?? AB08 OpenFOAM 28 February 2, 2016 02:22
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 07:42
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08


All times are GMT -4. The time now is 16:31.