These guidelines are based on the working folder located here.

Initial conditions: the 0/ folder


1) The include/ sub-folder

A call to a dictionary located in the 0/include/ sub-folder can be made to avoid editing multiple files in the 0/ directory, in particular if the gas mixture is composed of many species. empty, cyclic, wedge, zeroGradient, and symmetry boundary patches can be put into include/boundaries. For instance, most fields in the 0/ folder require a zeroGradient outlet boundary condition (BC) and this patch can thus be replaced by a call to boundaries, as shown below

boundaryField
{ 
    [...]

    #include "include/boundaries"
}

In include/boundaries, the outlet BC would then be written as follows

outlet
{
    type            zeroGradient;
}

Similarly, it can become handy to group the initial conditions into a single file by calling the include/initialConditions dictionary and using the $ symbol. The include statement can be placed at the top of each file

FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include "include/initialConditions"

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform $velocityField;

boundaryField
{
    [...]
}

After repeating this operation for every field in the 0/ folder, the include/initialConditions dictionary may be defined as follows

Ttr       300;
Tve       $Ttr;
Tsurf     810;

pressure  5.18655;

UxInlet 1.131e4;
velocityInlet  ($UxInlet 0 0);
velocityField  (0 0 0);
velocityWall   (0 0 0);

Y_N2      0.767;
Y_O2      0.233;
Y_NO      0;
Y_N       0;
Y_O       0;

A simple bash or python script can edit the entries of this single dictionary and running parameterized simulations becomes much easier.



2) Species mass or molar fractions

Either the mass or molar fractions of all species appearing in the species() list must be given in the 0/ folder. OpenFOAM’s naming convention for mass fractions omits the prefix “Y_”, which means that the mass fraction of species N2 is simply called N2.

To initialise the simulation using molar fractions instead, rename the species files with the prefix “X_”, for example: X_N2. The include/initialConditions dictionary may then be defined to contain

X_N2      0.79;
X_O2      0.21;

When both species mass and molar fractions are given in a time folder, the simulation will (re)start using the species mass fractions.

2.1 Non-catalytic wall

A non-catalytic wall BC can be set-up using the zeroGradient wall boundary type

    wall
    {
        type            zeroGradient;
    }

 

2.2 Super-catalytic wall

For a super-catalytic wall, the mixture composition at the surface is that of the free-stream and its implementation is as follows

    inlet
    {
        type            fixedValue;
        value           uniform $Y_#speciesName;
    }

    wall
    {
        type            fixedValue;
        value           uniform $Y_#speciesName;
    }



3) Temperature fields

3.1 Trans-rotational temperature

The trans-rotational temperature field is printed as Tt and must always be present in the 0/ folder. Its implementation is identical to the temperature field in all official OpenFOAM solvers, except for the Smoluchowski temperature jump boundary condition. Some examples are given hereafter.

  • An isothermal wall
      wall
      {
          type            fixedValue;
          value           uniform $Tsurf;
      }
    
  • An adiabatic wall
      wall
      {
          type            zeroGradient;
      }
    
  • A wall with the Smoluchowski trans-rotational temperature jump BC
      wall
      {
          type            smoluchowskiJumpT;
          accommodationCoeff 1;
          Twall           uniform $Tsurf;
          value           uniform $Tsurf;
      }
    

 

3.2 Vibro-electronic temperature

3.2.1 Single vibro-electronic energy pool formulation

Please refer to D. §2.1 if you are not familiar with this code feature.

The mixture vibro-electronic temperature field is called Tv and must be present in the 0/ folder. The Smoluchowski vibro-electronic temperature jump BC is written as follows

    wall
    {
        type            smoluchowskiJumpTvMix;
        accommodationCoeff 1;
        Twall           uniform $Tsurf;
        value           uniform $Tsurf;
    }

 

3.2.2 Multiple vibro-electronic energy pools formulation

Please refer to D. §2.2 if you are not familiar with this code feature.

The species vibro-electronic temperature fields are called Tv_#speciesName and there are as many fields as there are species in the species() list. The Smoluchowski vibro-electronic temperature jump BC for molecule species is defined as

    wall
    {
        type            smoluchowskiJumpTv;
        accommodationCoeff 1;
        Twall           uniform $Tsurf;
        value           uniform $Tsurf;
    }



4) Velocity field

4.1 Maxwell velocity slip

The Maxwell velocity slip BC has been slightly re-written (the mean free path is now calculated according to the model chosen in the transportProperties dictionary) and is given by

    wall
    {
        type            maxwellSlipU;
        accommodationCoeff 1;
        Uwall           uniform $velocityWall;
        refValue        uniform $velocityWall;
        valueFraction   uniform 1.0;
        thermalCreep    true;
        curvature       true;
        value           uniform $velocityWall;
    }

 

4.2 Linear inlet ramp

The velocity at an inflow patch can be set to increase linearly with time from an offset value up to a velocity whose components are given by the entry refValue, components that are then multiplied by the amplitude scalar.

For example, a 0.1 ms-long linear increase in velocity from 50 m/s to 1000 m/s with no angle of attack nor slip angle (U is thus aligned with the x-axis: (1 0 0)) is obtained by setting up the rampInlet BC as

    inlet
    {
        type            rampInlet;
        refValue        uniform (1 0 0);
        offset          (50 0 0);
        amplitude       1000;
        tRamp           1e-4;
    }

To use the rampInlet BC, one line should be added to the system/controlDict dictionary

libs ("libhyStrathFiniteVolume.so");