RR in openFOAM

How RR is defined in OpenFOAM. We won’t dig into the code too much here. I come up with writing this when I read binary.C.

RR is defined in thermodynamicConstants.C as:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 namespace Foam
{
namespace constant
{
namespace thermodynamic
{

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Note: the 1e3 converts from /mol to /kmol for consistency with the
// SI choice of kg rather than g for mass.
// This is not appropriate for USCS and will be changed to an entry in
// the DimensionedConstants dictionary in etc/controlDict
const scalar RR = 1e3*physicoChemical::R.value();

...

} // End namespace thermodynamic
} // End namespace constant
} // End namespace Foam

R is defined in physicoChemicalConstants.H as:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
namespace Foam
{
namespace constant
{
namespace physicoChemical
{

...
//- Universal gas constant: default SI units: [J/mol/K]
extern const dimensionedScalar R;
...

} // End namespace physicoChemical
} // End namespace constant
} // End namespace Foam

If you want to use these two values, include constants.H and librarylibOpenFOAM when make the file. Test them use the following code:

1
2
Info << "RR is " << Foam::constant::thermodynamic::RR << nl;
Info << "R is " << Foam::constant::physicoChemical::R << nl;

Remember here RR is a dimensionless scalar and R is a dimensioned scalar.