14.4. Periodic Boundary Conditions

14.4.1. Overview

There are two forms of periodic boundary conditions available in MCell: traditional and mirrored geometry.

With traditional PBCs, molecules simply wrap around when they hit the edge of boundary. For instance, if a molecule hits the the positive X boundary of the periodic box, then it will wrap around to the negative X boundary and continue diffusing from there.

With the mirrored geometry form, the geometry is mirrored in adjacent boxes and molecules do not wrap around. When a molecule hits a boundary, it will continue diffusing in the mirrored adjacent geometry.

Note

The mirrored geometry does not actually exist but is made possible by keeping careful bookkeeping of all the molecules and the location of the virtual box that they are in.

14.4.2. Usage

14.4.2.1. Getting started

  • Define the molecule

    • Create a molecule by pressing the Plus button and name it vm.

    • Change the diffusion constant to 1e-6.

      _images/defined_molecules.png
  • Place the molecule

    • Create a release site by pressing the Plus button and name it rel_vm.

    • Set the molecule to vm.

    • Set the release location to .495.

    • Set the quantity to release 1000.

      _images/molecule_release1.png
  • Create the sampling box

    • Create a new cube by selecting the cube object button

    • Add it by selecting the Plus button.

    • Select the Diffuse material button.

      _images/add_samplingbox.png
    • Change the options of the cube.

      • Change the draw type to Textured.

      • Check the Object Transparent box.

      • Check the Material Transparent box.

      • Change Alpha to 0.250

      _images/sampling_box_options.png
  • Set the sampling box dimensions

    • With the cursor in the 3D window switch to edit mode[Tab key], keep the cursor in the 3D window and press the s key then press the x key and then type in .5. Then press the s key again and press x and type in .498.

    • Then press the s key and press y and type in .5, then press s again and press y and type in 0.198.

    • Then press the s key and press z and type in .5, then press s again and press z and type in 0.198.

    • You may need to set the x location to [.250] or such to line it up within the wire(box).

  • Create the plane object

    • Select plane object button

    • Add it by selecting the plus button

    • Select the Diffuse material button

    _images/add_plane.png
    • Change the options of the plane.

      • Change the draw type to Textured.

      • Check the Object Transparent box.

      • Check the Material Transparent box.

      • Change Alpha to 0.250

      _images/plane_object_options.png
  • Set the plane’s dimensions

    • With the cursor in the 3D window switch to edit mode[Tab key], keep the cursor in the 3D window and press the s key and press y and type in .5, then press s again and press y and type in 0.220.

    • Then press the s key and press z and type in .5, then press s again and press z and type in 0.220.

    • Note you may need to alter the rotation of an axis to align the plane with the cube.

  • Create the (cube)wire box

    • Select the Cube object button.

    • Add it by selecting the Plus button.

    _images/add_wired_cube.png
    • Change the draw type to Textured.

    _images/wire_cube_options.png
  • Set the cube(wire) dimensions

    • With the cursor in the 3D window switch to edit mode[Tab key], keep the cursor in the 3D window and press the s key then press the x key and then type in .5.

    • Then press the s key and press y and type in .5, then press s again and type in 0.2.

    • Then press the s again and press z and type in .5, then press s again and type in 0.2.

  • Then remove it from the object list by having the cube object selected and press the Minus button.

    _images/remove_cube_object.png
  • create a surface class

    • Press the Plus Button and rename it to Transp.

    _images/add_transp.png
    • Add the Transp properties by selecting the Plus button.

    • Change molecules to All Molecules.

    • Change orientation to Ignore.

    • Change Type to Transparent.

    _images/transp_properties.png
  • Assign the surface class

    • Add a new one by selecting the Plus button.

    • Change the Surface Class Name to transp.

    • Change Object Name to sampling_box.

    _images/assign_surface_class1.png
  • Count the molecules.

    • In the world.

      • Press the Plus button to add a new counter

      • Set the molecule to vm.

        _images/count_vm_world.png
    • In the sampling box.

      • Press the Plus button to add a new counter

      • Set the molecule to vm.

      • Select Object.

      • Change object to sampling_box.

        _images/count_vm_samplingbox.png

14.4.2.2. Defining the Boundaries

First make sure that all objects are lined up. The plane should be vertical in the middle of the wire box, and the sampling box should take up half of the wire box.

Periodic boundary conditions in MCell are used by defining a periodic box:

  • First select the Periodic boundary conditions Button

    _images/periodic_panel_h.png
  • Select the include checkbox

    _images/pbc_include.png
  • Make sure that these boxes are checked

    _images/checked_true.png
  • Set the Bounds of the condition:

    • X-Start = -0.5, Y-Start = -0.1, Z-Start = -0.1

    • X-End = 0.5, Y-End = 0.1, Z-End = 0.1

    _images/pbc_values.png

Like a normal MCell BOX object, the CORNERS define the lower left and upper right points of the box. Setting PERIODIC_TRADITIONAL to FALSE will use the mirrored geometry form of periodic boundaries. Each axis can be set to be periodic or not via the PERIODIC_X/Y/Z keywords.

There can only be one periodic box and you do not need to instantiate it.

Export and run the simulation, then reload the visualization.