|
[Sponsors] |
August 5, 2013, 21:54 |
Division of dimensioned scalars
|
#1 |
Senior Member
Joachim
Join Date: Mar 2012
Location: Paris, France
Posts: 145
Rep Power: 15 |
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 |
|
August 6, 2013, 04:50 |
|
#2 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 21 |
Did you try constructing your dimensionedScalar like this:
Code:
dimensionedScalar sA("A",dimensionSet(0,1,-1,0,0,0,0), 1.5); |
|
August 6, 2013, 10:09 |
|
#3 |
Senior Member
Joachim
Join Date: Mar 2012
Location: Paris, France
Posts: 145
Rep Power: 15 |
Problem solved! thanks
|
|
August 7, 2013, 10:53 |
|
#5 |
Senior Member
Joachim
Join Date: Mar 2012
Location: Paris, France
Posts: 145
Rep Power: 15 |
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 |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using trig/hyperbolic functions with dimensioned scalars | cpro | OpenFOAM Programming & Development | 4 | April 21, 2013 19:27 |
How to apply Transport Equation on DPM Scalars? | yuhai | FLUENT | 0 | May 19, 2010 11:38 |
generic scalars in star | manuutin | STAR-CD | 0 | August 7, 2009 07:05 |
about .run file and information of scalars | isidro | Siemens | 0 | March 11, 2004 12:37 |
The Field Scalars in Tascflow | Darcy | CFX | 0 | November 19, 2003 23:14 |