|
[Sponsors] |
dimensionedScalar + volScalarField is evaluated elementwisely ? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 29, 2012, 14:53 |
dimensionedScalar + volScalarField is evaluated elementwisely ?
|
#1 |
New Member
Tianyi LI
Join Date: Mar 2012
Posts: 4
Rep Power: 14 |
Hello everyone,
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 Code:
DT=(a1+b1*T)*pos(T1-T)+(a2+b2*T)*neg(T1-T)*pos(T2-T)+(a3+b3*T)*neg(T2-T); In creatFields.H, I have Code:
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 14:55. Reason: typo |
|
March 30, 2012, 04:12 |
|
#2 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
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. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
if-loop, volScalarField comparison | volker | OpenFOAM | 7 | March 6, 2020 21:03 |
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 11: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 11:07 |