-
Notifications
You must be signed in to change notification settings - Fork 0
Entrance Structure
Tomek Roszczynialski edited this page Apr 23, 2016
·
18 revisions
/elements/structures.py
- Single capillary
- Hexagonal structure (realistic)
- Load from file
Abstract class for objects (python sense) defining XZ distribution of capillaries at the lens entrance. Capillary radius for the whole simulation is defined within this class.
Predefined structures are avaiable:
- rIn - capillary radius
- xin - capillary entrance x-position
- zin - capillary entrance z-position
- default constructor Singular(self, xin=0, zin=0, rIn=0.05)
This class is usefull for single capillary tryouts
- rIn - capillary radius
- wall - distance between centers of neighboring capillaries is equal to rIn + 2*wall
- ny_bundle - number of bundles in the structure's diagonal
- nx_capillary - number of capillaries in one bundle's diagonal
- default constructor: HexStructure(self, rIn=0.005, wall=0.005, nx_capillary=5, ny_bundle=3)
Using all default values You can do:
In [10]: from elements import structures as es
In [11]: xhs = es.HexStructure()
In [12]: xhs.plot()
To change structure parameters use any of the constructor's keyword arguments:
In [13]: hxs = es.HexStructure(ny_bundle=7)
In [14]: hxs.plot()
Number of entrance channels: 703
- filepath - file with rows of float coordinates separated by a comma
- rIn - capillary radius, used later for simulations
- default constructor: FromFile(self, filepath, rIn=0.05)
If You place a file named example.csv in project directory, containing for example four lines like so:
0,0
0.1,0.1
-0.2,0.01
-1,0.2
Then:
In [1]: from elements import structures as es
In [2]: file_structure = es.FromFile('example.csv', 0.3)
In [3]: file_structure.plot()
Caution:
Please, be ware that You have to verify if the capillary radius value rIn is reasonable, in the example above radius is equal to 0.3 mm wich is more than the distance between capillaries and makes the setup not realistic.