|
[Sponsors] |
December 5, 2008, 15:29 |
Hi,
I was wondering how one
|
#1 |
Member
Daniel Harlacher
Join Date: Mar 2009
Location: Davis, CA, United States
Posts: 60
Rep Power: 17 |
Hi,
I was wondering how one can assign a dimension (units) to a variable in the source code. I want to specify a time for example - how would I define the variable to be able to calculate with the units ? thanks harly |
|
December 5, 2008, 19:20 |
Hi Daniel
Please use:
di
|
#2 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
Hi Daniel
Please use: dimensionedScalar dimensionedVector etc for this purpose. OpenFOAM uses a SI Units based dimensionset [mass length time temp etc etc etc] - don't remember all of the names. So a dimension less scalar has [0 0 0 0 0 0 0] as the dimension set A dimesionedScalar should have a value and dimension. Taking your problem of defining the time with units: dimensionedScalar myTime ( "myTime", dimensionSet(0 0 1 0 0 0 0), 0.0 ) Hope that helps. Also please try some forum browsing if your problem is not what I explain here. Kind Regards Jaswi |
|
December 5, 2008, 19:49 |
Hi,
thanks for the answer -
|
#3 |
Member
Daniel Harlacher
Join Date: Mar 2009
Location: Davis, CA, United States
Posts: 60
Rep Power: 17 |
Hi,
thanks for the answer - do I have to include sth. or do I have to define this in a special place because I am getting an error and I cannot understand what the mistake is. I just copied your example and wanted to display myTime, but it won't compile. thanks |
|
December 7, 2008, 16:44 |
Hi Daniel
It will help the
|
#4 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
Hi Daniel
It will help the forum to provide any feedback if you will please either post the error or the code which gives you error so that one could figure out if any of the header files to be included are missing Kind Regards Jaswi |
|
December 7, 2008, 17:33 |
Hi,
yes you are right that
|
#5 |
Member
Daniel Harlacher
Join Date: Mar 2009
Location: Davis, CA, United States
Posts: 60
Rep Power: 17 |
Hi,
yes you are right that would make it a lot easier - I will have the possibility to upload it tomorrow - maybe you can have a look at it then. thanks - harly |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDS source term units | Ale | FLUENT | 3 | March 29, 2017 07:08 |
Units of additonal Variable and its source | Gauranga Das | CFX | 2 | December 6, 2007 03:59 |
UDF Source Term Units? | Brian | FLUENT | 1 | October 24, 2005 09:15 |
About units of mass source term | bg2306 | FLUENT | 0 | April 1, 2005 11:46 |
Source term units in 2D | Chief | FLUENT | 1 | August 23, 2004 12:40 |