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

units OpenFOAM

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

Like Tree1Likes
  • 1 Post By colinB

Reply
 
LinkBack Thread Tools Display Modes
Old   June 5, 2013, 07:37
Default units OpenFOAM
  #1
Member
 
Luca
Join Date: Mar 2013
Posts: 59
Rep Power: 3
LM4112 is on a distinguished road
Good morning all

I have a doubt regarding how OpenFOAM reads the units. For example the velocity is always [0 1 -1 0 0 0 0], it doesn`t matter if I use meters or millimiters. Only the initial value (the number I mean) changes. Is it correct?
LM4112 is offline   Reply With Quote

Old   June 5, 2013, 09:14
Default
  #2
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 294
Rep Power: 11
Lieven will become famous soon enough
Hi Luca,

In principle OF can work with any system of units but by default it uses the SI units.
But it is pretty easy to deviate from it. The only thing you need to be aware of, is that you need to change the values of constants accordingly (e.g. viscosity in mm/s instead of m/s).

Have a look at http://www.openfoam.org/docs/user/basic-file-format.php for more information.

Cheers,

Lieven
Lieven is offline   Reply With Quote

Old   June 5, 2013, 09:27
Default
  #3
Member
 
Luca
Join Date: Mar 2013
Posts: 59
Rep Power: 3
LM4112 is on a distinguished road
Hi Lieven, thanks for the fast reply.
Then I have to change only the "numbers". I mean if I use mm instead of m I have to scale each value that concerns the length (for example pressure, velocity etc..) and I am not supposed to touch the numbers between the brackets that identify the dimension (for example the velocity is still 0 1 -1 0 0 0 as it means length per time and not meter per second).
I guess that the values are just "numbers" for the solver. They just have to be consistent. Do you agree?
LM4112 is offline   Reply With Quote

Old   June 5, 2013, 09:37
Default
  #4
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 294
Rep Power: 11
Lieven will become famous soon enough
Yep, that's how I see it.

But just to give you my opinion, if there is no reason except for 'convenience' to deviate from SI units, I would not do it. The chance you make errors with it are relatively big (especially with respect to post-processing).

Cheers,

Lieven
Lieven is offline   Reply With Quote

Old   June 5, 2013, 09:40
Default
  #5
Member
 
Luca
Join Date: Mar 2013
Posts: 59
Rep Power: 3
LM4112 is on a distinguished road
the problem is that my mesh is in mm, then I want to convert all the values in mm instead of convert the mesh in meters (that in my case is much more time demanding)

best regards,
Luca
LM4112 is offline   Reply With Quote

Old   June 5, 2013, 09:47
Default
  #6
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9
colinB is on a distinguished road
what kind of mesh do you have?

if it is a blockMesh mesh you have the entity convertToMeters
in the very beginning where you can choose the dimensions.

if the mesh is created with a stl in sHM you can scale down the stl with:

surfaceTransformPoints input.stl output.stl -scale '(0.1 0.1 0.1)'

where the three 0.1 's indicate the scaling in x y and z direction

Now if you happen to have a totally different mesh
use transformPoints in a similar way as surfaceTransformPoints.

for more detailed information on these commands type
e.g. transformPoint -help
or see the user guide in the utilities chapter where there
are further hints on other mesh manipulation utilities.

this should solve your problems with the mesh units

regards
colinB is offline   Reply With Quote

Old   June 5, 2013, 09:52
Default
  #7
Member
 
Luca
Join Date: Mar 2013
Posts: 59
Rep Power: 3
LM4112 is on a distinguished road
I used ICEM to build the mesh. The problem is that I have different meshes up to 30 million size full hexa and it would be very time demanding to scale all of them. I guess it's easier to use mm.

best regards
Luca
LM4112 is offline   Reply With Quote

Old   June 5, 2013, 10:16
Default
  #8
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9
colinB is on a distinguished road
I don't get the problem.
If you convert the mesh to OF
and use transformPoints command the issue should be solved
within minutes even with 30 mio cells.
It is a fully automated process and gives completely satisfying results.

regards
Tobi likes this.
colinB is offline   Reply With Quote

Old   June 5, 2013, 10:19
Default
  #9
Member
 
Luca
Join Date: Mar 2013
Posts: 59
Rep Power: 3
LM4112 is on a distinguished road
sorry Colin I didn't read you reply properly. I will definitely try to use transformPoints. I'll let you know if it works properly, thanks

best regards
LM4112 is offline   Reply With Quote

Old   June 5, 2013, 11:20
Default
  #10
Member
 
Luca
Join Date: Mar 2013
Posts: 59
Rep Power: 3
LM4112 is on a distinguished road
Thanks a lot Colin, it worked perfectly.

best regards
Luca
LM4112 is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM - Validation of Results Ahmed OpenFOAM Running, Solving & CFD 9 June 22, 2011 18:59
OpenFOAM 1.6.x, 1.7.0 and 1.7.x are not fully prepared to work with gcc-4.5.x wyldckat OpenFOAM Bugs 18 October 21, 2010 05:51
How to Install OpenFOAM on 64 Ubuntu 9.04 hansel OpenFOAM Installation 62 March 19, 2010 15:43
OpenFOAM Training in Europe and USA hjasak OpenFOAM 0 August 8, 2008 05:33
OpenFOAM Training and Workshop Hrvoje Jasak Main CFD Forum 0 October 7, 2005 07:14


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