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

How to equate a dimensional value to a scalar

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 30, 2017, 01:01
Default How to equate a dimensional value to a scalar
  #1
New Member
 
Ram
Join Date: Dec 2017
Posts: 2
Rep Power: 0
ramsri95 is on a distinguished road
Hi All,

I'm trying to use PimpleFOAM to solve a channel flow. I wanted to obtain the pressure gradient used the maintain a constant mass flux. The pressure gradient in meanVelocityForce is a scalar, hence has dimensions of [0 0 0 0 0 0 0]. But I want to either convert it to a dimensionedScalar of [0 1 -2 0 0 0 0] or equate it to another dimensioned Scalar I've created with the above mentioned set.

I keep getting the error that
Different dimensions for =
dimensions : [0 1 -2 0 0 0 0] = [0 0 0 0 0 0 0]

Can someone please help!

Thanks!
Ram
ramsri95 is offline   Reply With Quote

Old   December 30, 2017, 16:02
Default
  #2
Senior Member
 
shereez234's Avatar
 
M Sereez
Join Date: Jan 2014
Location: England
Posts: 353
Blog Entries: 1
Rep Power: 13
shereez234 is on a distinguished road
Quote:
Originally Posted by ramsri95 View Post
Hi All,

I'm trying to use PimpleFOAM to solve a channel flow. I wanted to obtain the pressure gradient used the maintain a constant mass flux. The pressure gradient in meanVelocityForce is a scalar, hence has dimensions of [0 0 0 0 0 0 0]. But I want to either convert it to a dimensionedScalar of [0 1 -2 0 0 0 0] or equate it to another dimensioned Scalar I've created with the above mentioned set.

I keep getting the error that
Different dimensions for =
dimensions : [0 1 -2 0 0 0 0] = [0 0 0 0 0 0 0]

Can someone please help!

Thanks!
Ram
You can multiply it with a dimensionedScalar "one" of [ 0 1 -2 0 0 0 0]. But when there is different dimensions usually it means somewhere you have made a mistake in the derivation or something.

[ 0 1 -2 0 0 0 0 ] means the units is m/s2.
shereez234 is offline   Reply With Quote

Old   January 2, 2018, 03:08
Default
  #3
New Member
 
Ram
Join Date: Dec 2017
Posts: 2
Rep Power: 0
ramsri95 is on a distinguished road
Quote:
Originally Posted by shereez234 View Post
You can multiply it with a dimensionedScalar "one" of [ 0 1 -2 0 0 0 0]. But when there is different dimensions usually it means somewhere you have made a mistake in the derivation or something.

[ 0 1 -2 0 0 0 0 ] means the units is m/s2.
Hey,

Thanks a lot! Apparently it turns out that the order of multiplication matters as mentioned in the file Scalar.H

Thanks a A lot!
ramsri95 is offline   Reply With Quote

Reply

Tags
adding dimensions, dimensionedscalar


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
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 05:18
Division by zero exception - loop over scalarField Pat84 OpenFOAM Programming & Development 6 February 18, 2017 06:57
Issue symmetryPlane 2.5d extruded airfoil simulation 281419 OpenFOAM Running, Solving & CFD 5 November 28, 2015 14:09
Diverging solution in transonicMRFDyMFoam tsalter OpenFOAM Running, Solving & CFD 30 July 7, 2014 07:20
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 02:47


All times are GMT -4. The time now is 22:13.