CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

dimension [0 0 -0 0 0 0 0]?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 10, 2014, 00:49
Default dimension [0 0 -0 0 0 0 0]?
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 849
Rep Power: 18
sharonyue is on a distinguished road
Hi guys,

I have a volScalarField,
Code:
volScalarField epsilonD(pow(epsilon/pow(d,2),1/3));
you can see that epsilon's dimension is [0 2 -3 0 0 0 0] and d's dimension is [0 1 0 0 0 0 0], So epsilonD's dimension should be [0 0 -1 0 0 0 0]

But openfoam tell me its dimention is [0 0 -0 0 0 0 0]?

Any ideas?
sharonyue is offline   Reply With Quote

Old   April 10, 2014, 00:56
Default
  #2
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 849
Rep Power: 18
sharonyue is on a distinguished road
volScalarField epsilonD(pow(epsilonF,1/3));

This is very simple, epsilonF's dimension is [0 0 -3 0 0 0 0] , but epsilonD's dimention is [0 0 -0 0 0 0 0]
sharonyue is offline   Reply With Quote

Old   April 10, 2014, 04:16
Default
  #3
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 849
Rep Power: 18
sharonyue is on a distinguished road
Solved.

Code:
volScalarField epsilonD(pow(epsilonF,1.0/3.0));
I checked it out in dimensionSet.C and I got this piece of code:
Code:
Foam::dimensionSet Foam::cbrt(const dimensionSet& ds)
{
    return pow(ds, 1.0/3.0);
}
..........................

Foam::dimensionSet Foam::pow(const dimensionSet& ds, const scalar p)
{
    dimensionSet dimPow
    (
        ds[dimensionSet::MASS]*p,
        ds[dimensionSet::LENGTH]*p,
        ds[dimensionSet::TIME]*p,
        ds[dimensionSet::TEMPERATURE]*p,
        ds[dimensionSet::MOLES]*p,
        ds[dimensionSet::CURRENT]*p,
        ds[dimensionSet::LUMINOUS_INTENSITY]*p
    );

    return dimPow;
}
I dont know if its a bug. But its solved right now. Any comments are welcomed.
sharonyue is offline   Reply With Quote

Old   April 10, 2014, 04:38
Default
  #4
Member
 
xuhe-openfoam
Join Date: Aug 2013
Location: DaLian,china
Posts: 82
Rep Power: 13
bieshuxuhe is on a distinguished road
int a=1;
int b=3;
float c=a/b;

when a and b both are int, c=0

best wishes!
bieshuxuhe is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get a single value from a volScalarField including the dimension safre OpenFOAM Programming & Development 18 May 20, 2016 09:01
Dimension of pressure: M/LT2 or L2/T2? gcengineer OpenFOAM Running, Solving & CFD 6 August 7, 2013 17:41
ANSYS Fluent 14.0, dimension problem? SteveFinnan ANSYS 2 June 14, 2013 10:12
the problem about dimension bojiezhang OpenFOAM 2 October 16, 2011 01:22
Dimension problem faroque OpenFOAM Running, Solving & CFD 5 February 19, 2008 09:56


All times are GMT -4. The time now is 23:10.