Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load RBC meshes taken from a simulation with Timm's code #733

Open
mobernabeu opened this issue Jan 31, 2020 · 4 comments
Open

Load RBC meshes taken from a simulation with Timm's code #733

mobernabeu opened this issue Jan 31, 2020 · 4 comments
Assignees

Comments

@mobernabeu
Copy link
Contributor

mobernabeu commented Jan 31, 2020

Timm's code runs a simulation on a cylinder and RBCs are output just before the centre of mass crosses the periodic boundary condition.

Requirements to load into HemeLB:

  1. RBC centre of mass needs to be projected to the plane of insertion.
  2. RBC needs to be orientated with flow. Timm's code flows in the x-axis.
  3. RBC node coordinates are given in lattice units but these are consistent with HemeLB's lattice units and meshes can be loaded directly.
  4. Timm's code writes RBCs in non-XML VTK format.
  5. RBC insertion time is given in the filename of the mesh.
  6. HemeLB's XML file needs a switch to be told to load RBCs from a folder

Write Python script to implement requirements 1-4.

HemeLB should load all meshes at once and keep a lookup table for which time steps require a cell insertion from disc. Requirement 5-6.

@mobernabeu
Copy link
Contributor Author

Requirements 5-6 will be implemented by a preprocessing step as below instead of inside HemeLB.

Given a directory with a number of .vtp files, we need a Python script that takes a .xml generated by the setup tool and for each file in the directory (e.g. one_cell_from_disk_t1000.vtp) appends the following XML elements in their right location, figuring out parameters T, X, Y:

<inlet>
(...)
   <insertcell template="one_cell_from_disk">
      <every units="s" value="1e10"/>  <!--A very large value to avoid more than one insertion-->
      <offset units="s" value="T"/>  <!--units can be "s" or LB-->
      <x units="m" value="X"/>  <!--units can be "m" or LB-->
      <y units="m" value="Y"/>
   </insertcell>
</inlet>

<redbloodcells>
(...)
   <cells>
      <cell name="one_cell_from_disk">
        <moduli>
          <bending units="LB" value="2.554e-05" />
          <surface units="LB" value="1e0" />
          <volume units="LB" value="1e0" />
          <dilation units="LB" value="0.5" />
          <strain units="LB" value="0.0002043" />
        </moduli>
        <shape mesh_path="one_cell_from_disk_t1000.vtp" />
        <scale units="m" value="1" />  <!--Set to 1 to leave coordinates in file unchanged-->
      </cell>
    </cells>
</redbloodcells>

@Romain-Enjalbert
Copy link

The .xml file has been updated to load .vtp files, however hemelb is currently unable to read the .vtp files as an input as standard input file is the .msh, which is in a different format.

@mobernabeu
Copy link
Contributor Author

HemeLB doesn't use the VTK API to read/write meshes at the moment, which means we would need to write our own (non-xml) VTK reader. Get preprocessing tools to turn meshes coming from Timm's simulations into .msh format and separately revamp mesh handling code in #734.

@mobernabeu
Copy link
Contributor Author

LoadDeformedCellTests checks that a cell loaded in deformed state relaxes to a different reference shape. Checked that this is the case visually, but programmatic check needs to be added to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants