SI to CGS

Riccardo Maione's picture
Submitted by Riccardo Maione on Mon, 04/27/2015 - 16:50

Hello all,

I am trying to run openfoam with CGS units with a compressible solver, I already tested this solver so I know it works as it should. 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 g/cm^3, 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

Riccardo Maione's picture

Riccardo Maione | Tue, 04/28/2015 - 08:50

I tried that is what I did, but this didn't work for me, I think this is related to the pressure and density. I used the input in CGS, so pressure is 1e6 barye and velocity inlet is 5 cm/s. 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), 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

thank you for your reply
Riccardo