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

Newly defined volScalarField "indexT" has different array ranges in paraview

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 29, 2016, 07:08
Default Newly defined volScalarField "indexT" has different array ranges in paraview
  #1
Member
 
Sebastian W.
Join Date: Nov 2012
Location: Saxony, Germany
Posts: 43
Rep Power: 13
nero235 is on a distinguished road
Send a message via ICQ to nero235
Hey guys,

I did some coding on the phaseFieldFoam solver and I created a new volScalarField "indexT" which has a data range of [0,1]. Here is the definition in the "createFields.H".

Code:
volScalarField indexT
(
        IOobject
        (
            "indexT",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        mesh,
        dimensionedScalar("indexT", dimless, scalar(0))
);
And here is where I set the values of "indexT"

Code:
//-Find cells inside of the reacting zone    
const dimensionedScalar sphereR = ::sqrt(scalar(3))*reacVel*runTime.timeOutputValue();
    
//-Set treshold to 5% of reaction zone radius 
const scalar tresh = 0.1*sphereR.value();
    
const volVectorField& C = mesh.C();

forAll(C,I)
{
        if (mag(C[I]-centerSp) < sphereR.value())
        {
            indexT[I] = scalar(1);
        }
        else if ((mag(C[I]-centerSp) >= (sphereR.value()-tresh)) && (mag(C[I]-centerSp) <= (sphereR.value()+tresh)))
        {
            indexT[I] = scalar(0.5);
        }   
        else
        {
            indexT[I] = scalar(0);
        }
}
I am wondering why paraview displays the two data arrays of "indexT" in different ranges. I am also not sure of what type these arrays are. I am guessing the dot means point data and the volume is cell data (see screen shot). I hope someone can shed some light on this problem and where I may have a bug in the code.

I am using OpenFOAM 2.2.0 and the solver is based on phaseFieldFoam.
Attached Images
File Type: png screen_paraview.png (28.9 KB, 10 views)
nero235 is offline   Reply With Quote

Old   September 30, 2016, 11:57
Default
  #2
Senior Member
 
Zeppo's Avatar
 
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 21
Zeppo will become famous soon enough
Your code says that OpenFoam writes only values in cell centers and on boundaries. You can look for yourself, just open the file in the time directories. ParaView reads this file and constructs (internally) point field with values interpolated from cells to points.
Zeppo is offline   Reply With Quote

Reply


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
Convert volScalarField to dimensionedScalar to be defined in transportProperties sabago OpenFOAM Programming & Development 8 June 1, 2015 12:11
[General] Paraview User defined view prapanj ParaView 3 January 3, 2014 20:54
UDF link fortran source yorelchr Fluent UDF and Scheme Programming 0 February 7, 2013 03:44
using METIS functions in fortran dokeun Main CFD Forum 7 January 29, 2013 04:06
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21


All times are GMT -4. The time now is 05:41.