# dimensionedScalar + volScalarField is evaluated elementwisely ?

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 March 29, 2012, 13:53 dimensionedScalar + volScalarField is evaluated elementwisely ? #1 New Member   Tianyi LI Join Date: Mar 2012 Posts: 4 Rep Power: 5 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);` before solving the laplacian equation. 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) );``` where ai, bi, T1 and T2 are scalars and DT is piecewise affine in [0,T1], [T1,T2] and [T2,+Inf]. Thank you very much for your help !! Last edited by tianyikillua; March 29, 2012 at 13:55. Reason: typo

 March 30, 2012, 03:12 #2 Senior Member     Anton Kidess Join Date: May 2009 Location: Delft, Netherlands Posts: 919 Rep Power: 17 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. *Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post wschosta OpenFOAM Running, Solving & CFD 5 May 6, 2015 10:20 AlmostSurelyRob OpenFOAM 2 December 13, 2010 06:24 Edy OpenFOAM 3 September 30, 2010 10:07 georlade OpenFOAM Programming & Development 2 July 6, 2010 02:19 volker OpenFOAM 5 April 23, 2010 14:18

All times are GMT -4. The time now is 00:40.

 Contact Us - CFD Online - Top