|
[Sponsors] |
Newly defined volScalarField "indexT" has different array ranges in paraview |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 29, 2016, 07:08 |
Newly defined volScalarField "indexT" has different array ranges in paraview
|
#1 |
Member
|
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)) ); 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 using OpenFOAM 2.2.0 and the solver is based on phaseFieldFoam. |
|
September 30, 2016, 11:57 |
|
#2 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 21 |
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.
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |