|March 29, 2012, 13:53||
dimensionedScalar + volScalarField is evaluated elementwisely ?
Join Date: Mar 2012
Posts: 4Rep Power: 6
I'd like to know if a dimensionedScalar (ex. T1) + volScalarField (ex. T) is still a volScalarField and the result is obtained elementwisely, that is : result(i)=T1+T(i).
I need also to use a scalar function (ex. pos) determing the positivity of a scalar. If I apply this function to a volScalarField (ex. T), can I still obtain a volScalarField and result(i)=pos(T(i)) ?
I wrote this because I'm now implementing a non-constant diffusivity in the laplacianFoam solver.
In mylaplacianFoam.C, I have
In creatFields.H, I have
volScalarField DT ( IOobject ( "DT", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), (a1+b1*T)*pos(T1-T)+(a2+b2*T)*neg(T1-T)*pos(T2-T)+(a3+b3*T)*neg(T2-T) );
Thank you very much for your help !!
Last edited by tianyikillua; March 29, 2012 at 13:55. Reason: typo
|March 30, 2012, 03:12||
Join Date: May 2009
Posts: 1,182Rep Power: 21
Yes, pos(T - X), where T is a volScalarField and X is a dimensionedScalar will return a volScalarField.
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
|Thread||Thread Starter||Forum||Replies||Last Post|
|Problems with creating a volScalarField||georlade||OpenFOAM Programming & Development||4||December 4, 2016 13:31|
|changing a volScalarField to a dimensionedScalar||wschosta||OpenFOAM Running, Solving & CFD||5||May 6, 2015 10:20|
|volScalarField for cell volumes and face surfaces||AlmostSurelyRob||OpenFOAM||2||December 13, 2010 06:24|
|Confused about how OF handles operation between volScalarField and dimensionedScalar||Edy||OpenFOAM||3||September 30, 2010 10:07|
|if-loop, volScalarField comparison||volker||OpenFOAM||5||April 23, 2010 14:18|