Division of dimensioned scalars

 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 5, 2013, 20:54 Division of dimensioned scalars #1 Senior Member   Joachim Join Date: Mar 2012 Location: Atlanta Posts: 140 Rep Power: 6 Hey everyone! I have a small problem with dimensioned scalars... let's say, I have dimensionedScalar sA = ("A", [0 1 -1 0 0 0 0], 1.5); dimensionedScalar sB = ("B", [0 1 0 0 0 0 0], 2.0); dimensionedScalar sC = ("C", [0 2 -1 0 0 0 0], 2.0); initially, I did sC/(sA*sB), but it turned out that the dimension of that scalar was [0 -1 -1 0 0 0 0] (??????) I tried the following: sA*sB -> [0 2 -1 0 0 0 0] 1/(sA*sB) -> [0 -2 1 0 0 0 0] sA/(sB*sC) -> [0 -1 -1 0 0 0 0] I checked in dimensionedScalar.H, but it seems that only the division and multiplication of a scalar with a dimensioned scalar are defined...(but then, why would the multiplication of sA and sB give the right result??) Has anyone already seen this happening? Thank you very much for your help! Joachim immortality likes this.

 August 6, 2013, 03:50 #2 Senior Member   Bernhard Join Date: Sep 2009 Location: Delft Posts: 790 Rep Power: 12 Did you try constructing your dimensionedScalar like this: Code: `dimensionedScalar sA("A",dimensionSet(0,1,-1,0,0,0,0), 1.5);` I am not so sure if you are constructing it correctly with your code. immortality likes this.

 August 6, 2013, 09:09 #3 Senior Member   Joachim Join Date: Mar 2012 Location: Atlanta Posts: 140 Rep Power: 6 Problem solved! thanks

 August 7, 2013, 03:52 #4 Senior Member   Elvis Join Date: Mar 2009 Location: Sindelfingen, Germany Posts: 579 Blog Entries: 5 Rep Power: 13 Hi Joachim, and could you explain the solution, would be great if you share for the others that will visit this discussion Thx´s elvis

 August 7, 2013, 09:53 #5 Senior Member   Joachim Join Date: Mar 2012 Location: Atlanta Posts: 140 Rep Power: 6 Hi, Bernhard was completely right. Actually, I was directly reading the dimensionedScalars from a dictionary in the .C file, I was calling: const dimensionedScalar Uinf(perturbDict.lookup("Uinf")); You could find this in the dictionary: Uinf Uinf [0 1 -1 0 0 0 0] 10.0; What is pretty strange is that it actually worked...for some cases. I changed it to: const dimensionedScalar Uinf("Uinf", dimensionSet(0,1,-1,0,0,0,0), readScalar(perturbDict.lookup("Uinf"))); with Uinf 10.0 in the dictionary. It works just fine. Hope that will help somebody else one day. Joachim elvis likes this.

 August 8, 2013, 01:53 #6 Senior Member   Elvis Join Date: Mar 2009 Location: Sindelfingen, Germany Posts: 579 Blog Entries: 5 Rep Power: 13 Thx for the explaination greets elvis

 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 cpro OpenFOAM Programming & Development 4 April 21, 2013 18:27 yuhai FLUENT 0 May 19, 2010 10:38 manuutin STAR-CD 0 August 7, 2009 06:05 isidro CD-adapco 0 March 11, 2004 12:37 Darcy CFX 0 November 19, 2003 23:14

All times are GMT -4. The time now is 06:01.