CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Dimensionless parameters

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By olesen

LinkBack Thread Tools Search this Thread Display Modes
Old   January 15, 2009, 16:26
Default Dimensionless parameters
Senior Member
Antonio Martins
Join Date: Mar 2009
Location: Porto, Porto, Portugal
Posts: 112
Rep Power: 17
titio is on a distinguished road
Send a message via MSN to titio Send a message via Skype™ to titio
Hi all,

I need to define in the transport properties dictionary that do not have dimensions. My strategy was to define them as dimensioned, but placing only zeros in the dimensions definitions. Is this correct, or there is any command that can be used?

Thanks in advance,

titio is offline   Reply With Quote

Old   January 16, 2009, 02:59
Default Hi Put the following code i
Join Date: Mar 2009
Location: Mannheim - Vincennes - Valenciennes, Deutchland - France
Posts: 34
Rep Power: 17
floooo is on a distinguished road

Put the following code in createFields.H:

dimensionedScalar name

and then this one in transportProperties files:

name name [0 0 0 0 0 0 0] 0.5;

floooo is offline   Reply With Quote

Old   January 16, 2009, 05:11
Default I'd first recommend adding a s
Senior Member
Mark Olesen
Join Date: Mar 2009
Posts: 1,708
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
I'd first recommend adding a subdictionary to transport properties to avoid possible collision with existing or future names and to cleanly group your variables. I'd also assume that you'd like to enter dimensionless variables without needing to enter the "[0 0 0 0 0]" dimensions, or even bother with adding the name twice (once for the dictionary keyword and once for the dimensionedScalar).

In transportProperties (or somewhere else), add your subdictionary:

firstParam 1.0;
secondParam 2.0;

Then in your code (eg, createFields.H), use the lookupOrAddToDict static member:

dimensionedScalar param1
("firstParam", antonioDict, 10)

dimensionedScalar param2
( "secondParam", antonioDict, 20 )

dimensionedScalar param3
("thirdParam", antonioDict, 30)

This approach not only saves lots of typing in the dictionary, it also lets you specify default values.

If you wish to be extra safe, you'll want to check the original dictionary (eg, transportProperties) for the "antonioSpecialDict" first, and supply the code with an alternative place to edit if necessary.

I guess that dimensionedType should actually have a normal dict lookup (eg, lookupOrDefault) that doesn't alter the dictionary. Maybe you should submit a enhancement request for that.
HakikiCanakkaleli likes this.
olesen is offline   Reply With Quote

Old   February 29, 2016, 03:26
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0
13msmemusman is on a distinguished road
Simply use

varible = runTime.controlDict().lookupOrDefault<scalar>("var ible", 0);
13msmemusman is offline   Reply With Quote

Old   December 10, 2016, 07:06
Smile to use the dimensionless N-S equations in OpenFOAM
Senior Member
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 11
6863523 is on a distinguished road
I want to use the dimensionless equations in OpenFOAM. Anyone knows how to turn off the dimension checking? I have posted my problem here
How to use the dimensionless N-S equations in OpenFOAM
Thank you in advance for any suggestions.
Best Regards,
6863523 is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Dimensionless Analysis Seamus FLUENT 1 February 28, 2011 12:18
Dimensionless numbers kuba FLUENT 2 September 6, 2007 04:48
Dimensionless quantities badri1979 OpenFOAM Running, Solving & CFD 1 August 22, 2006 17:47
dimensionless equation Subrat Das CFX 0 December 10, 2001 05:30

All times are GMT -4. The time now is 20:29.