Constructing input files

Here we will look through the various components of the input.xml file found in examples/bifurcation/bifurcation_hires/ folder in the HemeLB download.

Simulation information

<?xml version="1.0"?>
<hemelbsettings version="3">
  <simulation>
    <step_length units="s" value="1e-5"/>
    <steps units="lattice" value="5000"/>
    <stresstype value="1"/>
    <voxel_size units="m" value="5e-5"/>
    <origin units="m" value="(0.0,0.0,0.0)"/>
  </simulation>
  <geometry>
    <datafile path="bifurcation.gmy"/>
  </geometry>
  <initialconditions>
    <pressure>
      <uniform units="mmHg" value="0.001"/>
    </pressure>
  </initialconditions>
  <monitoring>
    <incompressibility/>
  </monitoring>

This sets the main simulation parameters of:

  • Time step - step_length
  • Simulation duration - steps
  • Lattice spacing - voxel_size
  • Simulation domain geometry file
  • Initial conditions
  • Parameters for instability monitoring

Boundary conditions

All input and outlet locations of a simulation have their parameters described independently. Note the freedom of using either lattice or physical units. For this example we have pressure conditions enforced for both cases.

Inlets

  <inlets>
    <inlet>
      <condition subtype="cosine" type="pressure">
        <amplitude units="mmHg" value="0.0"/>
        <mean units="mmHg" value="0.001"/>
        <phase units="rad" value="0.0"/>
        <period units="s" value="1"/>
      </condition>
      <normal units="dimensionless" value="(4.15565e-13,1.44689e-12,1)"/>
      <position units="lattice" value="(165.499,35.8291,3)"/>
    </inlet>
  </inlets>

The position of the inlet and orientation of its (inward pointing) normal is required for all locations (inlet and outlet)

Outlets

  <outlets>
    <outlet>
      <condition subtype="cosine" type="pressure">
        <amplitude units="mmHg" value="0.0"/>
        <mean units="mmHg" value="0.0"/>
        <phase units="rad" value="0.0"/>
        <period units="s" value="1"/>
      </condition>
      <normal units="dimensionless" value="(0.707107,-2.4708e-12,-0.707107)"/>
      <position units="lattice" value="(26.2137,35.8291,372.094)"/>
    </outlet>
    <outlet>
      <condition subtype="cosine" type="pressure">
        <amplitude units="mmHg" value="0.0"/>
        <mean units="mmHg" value="0.0"/>
        <phase units="rad" value="0.0"/>
        <period units="s" value="1"/>
      </condition>
      <normal units="dimensionless" value="(-0.707107,-4.27332e-12,-0.707107)"/>
      <position units="lattice" value="(304.784,35.8291,372.094)"/>
    </outlet>
  </outlets>

Although constant pressure profiles are applied here, sinusoidal conditions could also be imposed.

Simulation outputs

Finally we need to define what information is output by the simulation for later analysis. HemeLB provides a number of options for what gets returned here.

 <properties>
    <propertyoutput file="whole.dat" period="100">
      <geometry type="whole" />
      <field type="velocity" />
      <field type="pressure" />
    </propertyoutput>
    <propertyoutput file="inlet.dat" period="100">
      <geometry type="inlet" />
      <field type="velocity" />
      <field type="pressure" />
    </propertyoutput>
  </properties>
</hemelbsettings>

Here the properties section returns two items:

  1. Velocity and pressure of every lattice site in the domain and stores it in whole.dat
  2. Velocity and pressure of lattice sites on the inlet surface and stores it in inlet.dat

In both cases this occurs every 100 steps.

It is recommended that the whole option is used with caution as it can generate VERY large *.dat files

Next step: Running a simulation

With the input files now prepared, move to the next section for how to run a simulation

Next