September 29, 2016, 08:08
|
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: 14
|
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.
|
|
|