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

wrong dimension error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 24, 2023, 05:17
Default wrong dimension error
  #1
Senior Member
 
ztdep's Avatar
 
p ding
Join Date: Mar 2009
Posts: 427
Rep Power: 19
ztdep is on a distinguished road
Send a message via Yahoo to ztdep Send a message via Skype™ to ztdep
HTML Code:
YY
{
		type exprField;
        libs    (fieldFunctionObjects);
		dimensions [0 0 0 0 0 0 0];
		field YY;
		expression "(mag(pos().y())<=1) ? pos().y()/0.00546 : (2.0-pos().y())/0.00546";	
}
I use expreField fo to generate a new field "YY", but it feeds back the error info of
HTML Code:
  Different dimensions for '(a - b)'
     dimensions : [0 0 0 0 0 0 0] != [0 1 0 0 0 0 0]
I know the source is "(2.0-pos().y())" , but how to give 2.0 a unit or how to make pos.y() dimensionless.
Regards
ztdep is offline   Reply With Quote

Old   September 25, 2023, 02:51
Default
  #2
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 742
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Not sure.

Replace
Code:
YY
{
		type exprField;
        libs    (fieldFunctionObjects);
		dimensions [0 0 0 0 0 0 0];
		field YY;
		expression "(mag(pos().y())<=1) ? pos().y()/0.00546 : (2.0-pos().y())/0.00546";	
}
by

Code:
YY
{
		type exprField;
        libs    (fieldFunctionObjects);
		dimensions [0 1 0 0 0 0 0];
		field YY;
		expression "(mag(pos().y())<=1) ? pos().y()/0.00546 : (2.0-pos().y())/0.00546";	
}
?
dlahaye is offline   Reply With Quote

Old   September 25, 2023, 02:57
Default
  #3
Senior Member
 
ztdep's Avatar
 
p ding
Join Date: Mar 2009
Posts: 427
Rep Power: 19
ztdep is on a distinguished road
Send a message via Yahoo to ztdep Send a message via Skype™ to ztdep
Quote:
Originally Posted by dlahaye View Post
Not sure.

Replace
Code:
YY
{
		type exprField;
        libs    (fieldFunctionObjects);
		dimensions [0 0 0 0 0 0 0];
		field YY;
		expression "(mag(pos().y())<=1) ? pos().y()/0.00546 : (2.0-pos().y())/0.00546";	
}
by

Code:
YY
{
		type exprField;
        libs    (fieldFunctionObjects);
		dimensions [0 1 0 0 0 0 0];
		field YY;
		expression "(mag(pos().y())<=1) ? pos().y()/0.00546 : (2.0-pos().y())/0.00546";	
}
?
Thanks ,but it doesn't work, still gives the same error.
the problem is the dimension of the number "2.0" is diffreent from pos().y() .
ztdep is offline   Reply With Quote

Old   September 25, 2023, 03:14
Default
  #4
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 742
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Not sure.

Replace y() by y.value() ?
dlahaye is offline   Reply With Quote

Old   September 26, 2023, 21:37
Default
  #5
Senior Member
 
ztdep's Avatar
 
p ding
Join Date: Mar 2009
Posts: 427
Rep Power: 19
ztdep is on a distinguished road
Send a message via Yahoo to ztdep Send a message via Skype™ to ztdep
Quote:
Originally Posted by dlahaye View Post
Not sure.

Replace y() by y.value() ?
Unknown method: value in expression at position:51
<<<<
(pos().y()<=1) ? pos().y()/0.00546 : (2.0-pos().y().value())/0.00546
^^^^ near here
ztdep 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
Building OpenFOAM1.7.0 from source ata OpenFOAM Installation 46 March 6, 2022 13:21
Undeclared Identifier Errof UDF SteveGoat Fluent UDF and Scheme Programming 7 October 15, 2014 07:11
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 12:34
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 03:59.