22-rx_reflective_surface_bug.mdl 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /***************************************************************************
  2. * Test 22: Testing reaction between volume molecule and surface
  3. * when surface class is declared REFLECTIVE and when it is
  4. * REFLECTIVE by default.
  5. *
  6. * Volume molecules A are released inside boxes "box_refl", and B
  7. * inside "box_default".
  8. * Let one box "box_refl" interior be REFLECTIVE through SURFACE_CLASS
  9. * "my_refl". Let another box "box_default" also has interior
  10. * REFLECTIVE but through the SURFACE_CLASS "my_default" (in fact
  11. * default property).
  12. *
  13. * Reflective surfaces we can specify directly through
  14. * SURFACE_CLASS "my_refl{REFLECTIVE = A}" or indirectly
  15. * through SURFACE_CLASS "my_default {} " using the fact that
  16. * all surfaces by default are REFLECTIVE.
  17. *
  18. * The bug in the code prevented reaction
  19. * of the type vol_mol' @ my_refl; -> ... [rate] to happen, while
  20. * reaction of the type vol_mol' @ my_default; -> ...[rate]
  21. * did happened.
  22. *
  23. * Here we test the bug fix.
  24. *
  25. * Author: Boris Kaminsky <[email protected]>
  26. * Date: 2011-01-14
  27. ***************************************************************************/
  28. basename = "22-rx_reflective_surface_bug"
  29. countdir = "dat/" & basename & "/"
  30. dt = 1e-6
  31. TIME_STEP = dt
  32. TIME_STEP_MAX = dt
  33. ITERATIONS = 100
  34. EFFECTOR_GRID_DENSITY = 10000
  35. boxdims = 0.13
  36. VACANCY_SEARCH_DISTANCE = 1
  37. DEFINE_MOLECULES
  38. {
  39. A {DIFFUSION_CONSTANT_3D = 2e-7}
  40. B {DIFFUSION_CONSTANT_3D = 2e-7}
  41. sm_L {DIFFUSION_CONSTANT_2D = 2e-7}
  42. sm_M {DIFFUSION_CONSTANT_2D = 2e-7}
  43. }
  44. DEFINE_SURFACE_CLASSES
  45. {
  46. my_refl {REFLECTIVE = A; }
  47. my_default { }
  48. }
  49. DEFINE_REACTIONS
  50. {
  51. A' @ my_refl; -> sm_L'[1e11]
  52. B' @ my_default; -> sm_M'[1e11]
  53. }
  54. fuzz = 0.01
  55. x = 2*boxdims + fuzz
  56. box_refl BOX
  57. {
  58. CORNERS = [-boxdims,-boxdims,-boxdims] , [boxdims,boxdims,boxdims]
  59. DEFINE_SURFACE_REGIONS
  60. {
  61. whole_mesh{
  62. ELEMENT_LIST = [ALL_ELEMENTS]
  63. SURFACE_CLASS = my_refl
  64. }
  65. }
  66. }
  67. box_default BOX
  68. {
  69. CORNERS = [-boxdims,-boxdims,-boxdims] , [boxdims,boxdims,boxdims]
  70. DEFINE_SURFACE_REGIONS
  71. {
  72. whole_mesh{
  73. ELEMENT_LIST = [ALL_ELEMENTS]
  74. SURFACE_CLASS = my_default
  75. }
  76. }
  77. TRANSLATE = [x,0,0]
  78. }
  79. case1 OBJECT
  80. {
  81. box_refl OBJECT box_refl {}
  82. box_default OBJECT box_default {}
  83. A_release RELEASE_SITE {SHAPE = case1.box_refl MOLECULE = A NUMBER_TO_RELEASE = 100}
  84. B_release RELEASE_SITE {SHAPE = case1.box_default MOLECULE = B NUMBER_TO_RELEASE = 100}
  85. }
  86. xleft = x - boxdims - fuzz
  87. xright = x + boxdims
  88. PARTITION_X = [[xleft TO xright STEP 0.013]]
  89. PARTITION_Y = [[-boxdims-fuzz TO boxdims+fuzz STEP 0.013]]
  90. PARTITION_Z = [[-boxdims-fuzz TO boxdims+fuzz STEP 0.013]]
  91. INSTANTIATE world OBJECT
  92. {
  93. b1 OBJECT case1 {}
  94. }
  95. REACTION_DATA_OUTPUT
  96. {
  97. ITERATION_LIST = [[10 TO 100 STEP 1]]
  98. HEADER = "# "
  99. {
  100. (COUNT [sm_L, WORLD]): "sm_L",
  101. (COUNT [sm_M, WORLD]): "sm_M"
  102. } => countdir & "refl.dat"
  103. }