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

the problem about dimension

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2011, 04:58
Default the problem about dimension
  #1
Member
 
bojiezhang
Join Date: Jan 2010
Posts: 64
Rep Power: 16
bojiezhang is on a distinguished road
hello everyFoamer:
I have two problems, and hope someone can help me,
1:when I use the function below:
Foam::cos( -omega*runTime.value())
the dimension of omega is[0,0,-1,0,0,0,0],
It can compile pretty well, but when caculating, the error comes as below:
ds not dimensionless
From function cos(const dimensionedScalar& ds)
2:when I assign the value as below:
mass[cellI] =A*omega*Foam::cos(-omega*runTime.value());
mass is volScalarField , and intialized as dimensionedScalar("zero", dimensionSet(0,1,-1,0,0,0,0), 0.0)
the dimension of A is [0,1,0,0,0,0,0],the dimension of omega is[0,0,-1,0,0,0,0],
when compiled , it shows "error":can not convert dimensioned<double> to double ;

what can I do , I really hope someone can give me some advice, thank you in advance!

bojiezhang
bojiezhang is offline   Reply With Quote

Old   October 15, 2011, 10:00
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
1) define omega as dimless , because when u use the value() function, it only returns the value of run time not its dimension!

2) its not important whats the dimension of volScalarField is, when you use just on array of it! its a scalar with out dimension so the left side should be dimensionless too, but ur left side is not dimension less, its an strange combination of [0 0 1 0 0 0 0]* cos [0 0 -1 0 0 0 0] for compiler, so define A as dimless too then
congratulation both ur problem get solved
nimasam is offline   Reply With Quote

Old   October 16, 2011, 01:22
Default
  #3
Member
 
bojiezhang
Join Date: Jan 2010
Posts: 64
Rep Power: 16
bojiezhang is on a distinguished road
Quote:
Originally Posted by nimasam View Post
1) define omega as dimless , because when u use the value() function, it only returns the value of run time not its dimension!

2) its not important whats the dimension of volScalarField is, when you use just on array of it! its a scalar with out dimension so the left side should be dimensionless too, but ur left side is not dimension less, its an strange combination of [0 0 1 0 0 0 0]* cos [0 0 -1 0 0 0 0] for compiler, so define A as dimless too then
congratulation both ur problem get solved
Thank you for your reply, the problem is solved successfully by your idea!
bojiezhang 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
conduction problem venkataramana OpenFOAM 3 December 1, 2013 08:30
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 05:43
Problem Importing Geometry ProE to CFX fatb0y CFX 3 January 14, 2012 20:42
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 07:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 20:13


All times are GMT -4. The time now is 09:41.