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

Changing to CGS units

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2015, 11:17
Default Changing to CGS units
  #1
New Member
 
riccardo maione
Join Date: Jun 2014
Posts: 13
Rep Power: 11
riccardomaione is on a distinguished road
Hello all,

I am trying to run openfoam with CGS units. All my initial conditions are in cgs, so pressure is 10^6 g/cm/s^2 (dimensions [1 -1 -2 0 ...]) and velocity in cm/s (dimensions [0 1 -1 0...]) , to solve a flow in a fluidised bed with air, in order to do so I added in the controlDict
DimensionedConstants
{
unitSet CGS; // SI; // USCS; //
CGSCoeffs
{
universal
{
c c [ 0 1 -1 0 0 0 0 ] 2.99792e+10; // speed of light in vacuum (cm/s)
G G [ -1 3 -2 0 0 0 0 ] 6.67429e-8; // gravitational constant (cm^3/(gs^2))
h h [ 1 2 -1 0 0 0 0 ] 6.62607e-27; // Planck's constant (erg.s)
R R [1 2 -2 -1 -1 0 0 ] 8.314e7; //universal gas constant (erg/mol*K)


}
electromagnetic
{
e e [ 0 0 1 0 0 1 0 ] 4.803204e-10; // elementary charge (statcoulomb)
R R [1 2 -2 -1 -1 0 0 ] 8.314e7; //universal gas constant

}
atomic
{
me me [ 1 0 0 0 0 0 0 ] 9.10938e-28; // electron mass (g)
mp mp [ 1 0 0 0 0 0 0 ] 1.67262e-24; // proton mass (g)
}
physicoChemical
{
mu mu [ 1 0 0 0 0 0 0 ] 1.66054e-24; // atomic mass unit (g)
k k [ 1 2 -2 -1 0 0 0 ] 1.38065e-16; // Boltzman constant (erg/K)

}
standard
{
//- Standard pressure [bar]
Pstd Pstd [ 1 -1 -2 0 0 0 0 ] 1000000; // 1 bar (barye)
//- Standard temperature [degK]
Tstd Tstd [ 0 0 0 1 0 0 0 ] 298.15; // should be same as in SI unit system
}
}
}
however when trying to run the case the density is like 10, when it should be 1e-3. what is the matter? someone has already done this passage and knows how to help?

every help is greatly appriciated,
Riccardo

Last edited by riccardomaione; April 24, 2015 at 09:39.
riccardomaione is offline   Reply With Quote

Old   April 24, 2015, 10:28
Default
  #2
New Member
 
riccardo maione
Join Date: Jun 2014
Posts: 13
Rep Power: 11
riccardomaione is on a distinguished road
noone knows how to pass from SI to another unit system?
riccardomaione is offline   Reply With Quote

Old   April 24, 2015, 10:36
Default
  #3
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

And how do you set initial conditions in your simulation?
alexeym is offline   Reply With Quote

Old   April 24, 2015, 12:05
Default
  #4
New Member
 
riccardo maione
Join Date: Jun 2014
Posts: 13
Rep Power: 11
riccardomaione is on a distinguished road
I used the input in CGS, so pressure is 1e6 barye and velocity inlet is 5 cm/s. Unfortunately I need this type of input because I have to couple it with a DEM program and I have been playing quite a lot in order to understand what isn't right

funny thing is that if I use the CGS constants and I set the SI input output (so the initial conditions are in SI) with the control dictionary, adding this to the controlDict:

DimensionSets
{
unitSet SI; // USCS

SICoeffs
{
// Basic units
kg kg [ 1 0 0 0 0 0 0 ] 1.0;
m m [ 0 1 0 0 0 0 0 ] 1.0;
s s [ 0 0 1 0 0 0 0 ] 1.0;
K K [ 0 0 0 1 0 0 0 ] 1.0;
mol mol [ 0 0 0 0 1 0 0 ] 1.0;
A A [ 0 0 0 0 0 1 0 ] 1.0;
Cd Cd [ 0 0 0 0 0 0 1 ] 1.0;

// Derived units
Hz Hz [ s^-1 ] 1.0;
N N [ kg m s^-2 ] 1.0;
Pa Pa [ N m^-2 ] 1.0;
J J [ N m ] 1.0;
W W [ J s^-1 ] 1.0;

// Some non-symbolic ones
area area [m^2] 1.0;
volume volume [m^3] 1.0;
density density [ kg m^-3 ] 1.0;
acceleration acceleration [ m s^-2 ] 1.0;
kinematicPressure kinematicPressure [ Pa density^-1 ] 1.0;

// Scaled units. Only allowed in dimensionedType (dimensionedScalar,
// dimensionedVector etc.) and UniformDimensionedField, not
// in DimensionedField or GeometricField
cm cm [ m ] 1e-2;
mm mm [ m ] 1e-3;
km km [ m ] 1e3;

// Set of units used for printing. Can be any basic or derived
// but not scaled (only supported for dimensionedScalar, etc)
writeUnits (kg m s K mol A Cd);
}
}

density is ok and 1 kg/m^3. However in order to understand what is going on, I used a string to output the universal gas constant. In this case the constant is ok with the correct value in CGS, but its dimensionality is in Kg and m!

I am a little frustrated , somebody knows what's going on?

thank you for your reply
Riccardo

Last edited by riccardomaione; April 30, 2015 at 03:31.
riccardomaione 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
Thermophysical Property Units johanz OpenFOAM Pre-Processing 2 December 16, 2018 10:08
[PyFoam] Problems with the new PyFoam release zfaraday OpenFOAM Community Contributions 13 December 9, 2014 18:58
[PyFoam] having problems with pyfoam Installation vitorspadetoventurin OpenFOAM Community Contributions 3 December 2, 2014 07:18
changing units in gambit Brendan FLUENT 2 August 13, 2012 09:12
Changing units in AVL Fire zaer AVL FIRE 2 July 18, 2012 00:27


All times are GMT -4. The time now is 06:05.