/**************************************************************************** * Test 04: All surface rxn types, simple test of equilibrium and reaction * rates. * * A quantitative test of the basic *-surface reaction types (uni, bi) * in various combinations with surface (and some volume) molecules and * always with surface class as one of the reactants. * This test is completely identical to the test "03-surface" * except that we add surface class to all reactions and we do not * test for trimolecular reactions. * * * * Authors: Jed Wing and Boris Kaminsky * Date: 2008-12-05, 2010-11-29, 2012-06-20 ****************************************************************************/ basename = "04-surface" countdir = "dat/" & basename & "/" vizdir = "./viz_dat/" & basename & "/" iterations = 10000 timestep = 1e-6 boxdims = 0.25 voldiffconst = 2.0e-6 surfdiffconst = 2.0e-6 num_u = 1000 num_b = 1000 sa = 6*(2*boxdims)^2 boxvol = 8*boxdims*boxdims*boxdims eq_b = num_b / 2 rf_ss = 0.1*1e6 * (sa / eq_b) / eq_b // Set reverse rates to expect approx 1 rxn every 10 timesteps rr_u = 2.0e2 rr_b = 2.0e2 // Compute forward rates to give equilibrium of 50% reacted c_b = (num_b / 2. / boxvol) * 1e15 / 6.022e23 rf_u = rr_u rf_b = rr_b / c_b VACANCY_SEARCH_DISTANCE = 2 ITERATIONS = iterations TIME_STEP = timestep TIME_STEP_MAX = 1.0 INCLUDE_FILE = "volmols.mdl" INCLUDE_FILE = "surfmols.mdl" DEFINE_MOLECULES { A_u {DIFFUSION_CONSTANT_2D = surfdiffconst} C_u {DIFFUSION_CONSTANT_2D = surfdiffconst} D_u {DIFFUSION_CONSTANT_2D = surfdiffconst} E_u {DIFFUSION_CONSTANT_2D = surfdiffconst} F_u {DIFFUSION_CONSTANT_2D = surfdiffconst} G_u {DIFFUSION_CONSTANT_2D = surfdiffconst} A_b {DIFFUSION_CONSTANT_2D = surfdiffconst} C_b {DIFFUSION_CONSTANT_2D = surfdiffconst} D_b {DIFFUSION_CONSTANT_2D = surfdiffconst} E_b {DIFFUSION_CONSTANT_2D = surfdiffconst} F_b {DIFFUSION_CONSTANT_2D = surfdiffconst} G_b {DIFFUSION_CONSTANT_2D = surfdiffconst} } DEFINE_SURFACE_CLASS my_surf{ } DEFINE_REACTIONS { /* 0 Volume reactants */ S_u, @ my_surf; -> B_u, [rf_u] : fwd_u /* unimol */ S_b1, + S_b2, @ my_surf; -> B_b, [rf_ss] : fwd_b /* bimol */ S_bt1, + S_bt2,@ my_surf; -> B_bt, [rf_ss] : fwd_bt /* bimol (via trimol code) */ S_b3, + S_b4to, @ my_surf; -> B_b2, [rf_ss] : fwd_b2 /* bimol (1 target only) */ S_bt3, + S_bt4to, @ my_surf; -> B_bt2, [rf_ss] : fwd_bt2 /* bimol (1 target only, via trimol code) */ B_u, @ my_surf; -> S_u, [rr_u] : rev_u B_b, @ my_surf; -> S_b1, + S_b2, [rr_b] : rev_b B_bt,@ my_surf; -> S_bt1, + S_bt2, [rr_b] : rev_bt B_b2, @ my_surf; -> S_b3, + S_b4to, [rr_b] : rev_b2 B_bt2,@ my_surf; -> S_bt3, + S_bt4to, [rr_b] : rev_bt2 /* 1 Volume reactant */ V_b1, + S_vb2' @ my_surf; -> B_vb' [rf_b] : fwd_vb /* bimol */ V_bt1, + S_vbt2'@ my_surf; -> B_vbt' [rf_b] : fwd_vbt /* bimol (via trimol code) */ V_b3, + S_vb4to' @ my_surf; -> B_vb2' [rf_b] : fwd_vb2 /* bimol (1 target only) */ V_bt3, + S_vbt4to' @ my_surf; -> B_vbt2' [rf_b] : fwd_vbt2 /* bimol (1 target only, via trimol code) */ B_vb' @ my_surf; -> V_b1, + S_vb2' [rr_b] : rev_vb B_vbt' @ my_surf; -> V_bt1, + S_vbt2' [rr_b] : rev_vbt B_vb2' @ my_surf; -> V_b3, + S_vb4to' [rr_b] : rev_vb2 B_vbt2'@ my_surf; -> V_bt3, + S_vbt4to' [rr_b] : rev_vbt2 /* these reactions will happen simultaneously we will check relative rxn rates between them */ A_u, -> C_u, [rf_u] : fwd_AC_u1 /* (1) */ C_u, -> A_u, [rr_u] : rev_AC_u1 /* (2) */ A_u, @ my_surf' -> C_u, [rf_u] : fwd_AC_u2 /* (3) */ C_u, @ my_surf' -> A_u, [rr_u] : rev_AC_u2 /* (4) */ A_u; @ my_surf' -> C_u, [rf_u] : fwd_AC_u3 /* (5) */ C_u; @ my_surf' -> A_u, [rr_u] : rev_AC_u3 /* (6) */ /* these reactions will happen simultaneously we will check relative rxn rates between them */ D_u, -> E_u, [rf_u] : fwd_DE_u1 /* (7) */ E_u, -> D_u, [rr_u] : rev_DE_u1 /* (8) */ D_u, @ my_surf' -> E_u, [0.5*rf_u] : fwd_DE_u2 /* (9) */ E_u, @ my_surf' -> D_u, [0.5*rr_u] : rev_DE_u2 /* (10) */ D_u; @ my_surf' -> E_u, [0.3*rf_u] : fwd_DE_u3 /* (11) */ E_u; @ my_surf' -> D_u, [0.3*rr_u] : rev_DE_u3 /* (12) */ /* these reactions will happen simultaneously we will check relative rxn rates between them */ F_u, -> G_u, [0.3*rf_u] : fwd_FG_u1 /* (13) */ G_u, -> F_u, [0.3*rr_u] : rev_FG_u1 /* (14) */ F_u, @ my_surf' -> G_u, [0.5*rf_u] : fwd_FG_u2 /* (15) */ G_u, @ my_surf' -> F_u, [0.5*rr_u] : rev_FG_u2 /* (16) */ F_u; @ my_surf' -> G_u, [rf_u] : fwd_FG_u3 /* (17) */ G_u; @ my_surf' -> F_u, [rr_u] : rev_FG_u3 /* (18) */ /* these reactions will happen simultaneously we will check relative rxn rates between them */ A_b, + C_b, -> D_b, [rf_ss] : fwd_AC_b1 /* (19) */ A_b, + C_b, @ my_surf' -> D_b, [rf_ss] : fwd_AC_b2 /* (20) */ A_b; + C_b; @ my_surf' -> D_b, [rf_ss] : fwd_AC_b3 /* (21) */ D_b; @ my_surf' -> A_b, + C_b, [rr_b] : rev_AC_b3 /* (22) */ /* these reactions will happen simultaneously we will check relative rxn rates between them */ E_b, + F_b, -> G_b, [rf_ss] : fwd_EF_b1 /* (23) */ E_b, + F_b, @ my_surf' -> G_b, [0.5*rf_ss] : fwd_EF_b2 /* (24) */ E_b; + F_b; @ my_surf' -> G_b, [0.3*rf_ss] : fwd_EF_b3 /* (25) */ G_b; @ my_surf' -> E_b, + F_b, [rr_b] : rev_EF_b3 /* (26) */ } little_box BOX { CORNERS = [-boxdims, -boxdims, -boxdims], [boxdims, boxdims, boxdims] DEFINE_SURFACE_REGIONS { whole_mesh { ELEMENT_LIST = [ALL_ELEMENTS] SURFACE_CLASS = my_surf } } } /* Starting X position for box placement */ x = 0 fuzz = 0.01 xleft = x - boxdims - fuzz /* S_u @ my_surf; <-> B_u */ case1 OBJECT { kosmos OBJECT little_box {} release_site_r RELEASE_SITE { SHAPE = case1.kosmos MOLECULE = S_u' NUMBER_TO_RELEASE = num_u / 2 } release_site_p RELEASE_SITE { SHAPE = case1.kosmos MOLECULE = B_u' NUMBER_TO_RELEASE = num_u / 2 } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz /* S_b1 + S_b2 @ my_surf; <-> B_b */ case2 OBJECT { kosmos OBJECT little_box {} release_site_r1 RELEASE_SITE { SHAPE = case2.kosmos MOLECULE = S_b1' NUMBER_TO_RELEASE = num_b / 2 } release_site_r2 RELEASE_SITE { SHAPE = case2.kosmos MOLECULE = S_b2' NUMBER_TO_RELEASE = num_b / 2 } release_site_p RELEASE_SITE { SHAPE = case2.kosmos MOLECULE = B_b' NUMBER_TO_RELEASE = num_b / 2 } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz /* S_bt1 + S_bt2 @ my_surf; <-> B_bt */ case3 OBJECT { kosmos OBJECT little_box {} release_site_r1 RELEASE_SITE { SHAPE = case3.kosmos MOLECULE = S_bt1' NUMBER_TO_RELEASE = num_b / 2 } release_site_r2 RELEASE_SITE { SHAPE = case3.kosmos MOLECULE = S_bt2' NUMBER_TO_RELEASE = num_b / 2 } release_site_p RELEASE_SITE { SHAPE = case3.kosmos MOLECULE = B_bt' NUMBER_TO_RELEASE = num_b / 2 } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz /* S_b3 + S_b4to @ my_surf; <-> B_b2 */ case4 OBJECT { kosmos OBJECT little_box {} release_site_r1 RELEASE_SITE { SHAPE = case4.kosmos MOLECULE = S_b3' NUMBER_TO_RELEASE = num_b / 2 } release_site_r2 RELEASE_SITE { SHAPE = case4.kosmos MOLECULE = S_b4to' NUMBER_TO_RELEASE = num_b / 2 } release_site_p RELEASE_SITE { SHAPE = case4.kosmos MOLECULE = B_b2' NUMBER_TO_RELEASE = num_b / 2 } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz /* S_bt3 + S_bt4to @ my_surf; <-> B_bt2 */ case5 OBJECT { kosmos OBJECT little_box {} release_site_r1 RELEASE_SITE { SHAPE = case5.kosmos MOLECULE = S_bt3' NUMBER_TO_RELEASE = num_b / 2 } release_site_r2 RELEASE_SITE { SHAPE = case5.kosmos MOLECULE = S_bt4to' NUMBER_TO_RELEASE = num_b / 2 } release_site_p RELEASE_SITE { SHAPE = case5.kosmos MOLECULE = B_bt2' NUMBER_TO_RELEASE = num_b / 2 } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz /* V_b1 + S_vb2 @ my_surf; <-> B_vb */ case9 OBJECT { kosmos OBJECT little_box {} release_site_r1 RELEASE_SITE { SHAPE = case9.kosmos MOLECULE = V_b1 NUMBER_TO_RELEASE = num_b / 2 } release_site_r2 RELEASE_SITE { SHAPE = case9.kosmos MOLECULE = S_vb2' NUMBER_TO_RELEASE = num_b / 2 } release_site_p RELEASE_SITE { SHAPE = case9.kosmos MOLECULE = B_vb' NUMBER_TO_RELEASE = num_b / 2 } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz /* V_bt1 + S_vbt2 @ my_surf; <-> B_vbt */ case10 OBJECT { kosmos OBJECT little_box {} release_site_r1 RELEASE_SITE { SHAPE = case10.kosmos MOLECULE = V_bt1 NUMBER_TO_RELEASE = num_b / 2 } release_site_r2 RELEASE_SITE { SHAPE = case10.kosmos MOLECULE = S_vbt2' NUMBER_TO_RELEASE = num_b / 2 } release_site_p RELEASE_SITE { SHAPE = case10.kosmos MOLECULE = B_vbt' NUMBER_TO_RELEASE = num_b / 2 } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz /* V_b3 + S_vb4to @ my_surf; <-> B_vb2 */ case11 OBJECT { kosmos OBJECT little_box {} release_site_r1 RELEASE_SITE { SHAPE = case11.kosmos MOLECULE = V_b3 NUMBER_TO_RELEASE = num_b / 2 } release_site_r2 RELEASE_SITE { SHAPE = case11.kosmos MOLECULE = S_vb4to' NUMBER_TO_RELEASE = num_b / 2 } release_site_p RELEASE_SITE { SHAPE = case11.kosmos MOLECULE = B_vb2' NUMBER_TO_RELEASE = num_b / 2 } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz /* V_bt3 + S_vbt4to @ my_surf; <-> B_vbt2 */ case12 OBJECT { kosmos OBJECT little_box {} release_site_r1 RELEASE_SITE { SHAPE = case12.kosmos MOLECULE = V_bt3 NUMBER_TO_RELEASE = num_b / 2 } release_site_r2 RELEASE_SITE { SHAPE = case12.kosmos MOLECULE = S_vbt4to' NUMBER_TO_RELEASE = num_b / 2 } release_site_p RELEASE_SITE { SHAPE = case12.kosmos MOLECULE = B_vbt2' NUMBER_TO_RELEASE = num_b / 2 } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz /* reactions (1) - (6) */ case13 OBJECT { kosmos OBJECT little_box {} release_site_r1 RELEASE_SITE { SHAPE = case13.kosmos MOLECULE = A_u, NUMBER_TO_RELEASE = num_u / 2 } release_site_r2 RELEASE_SITE { SHAPE = case13.kosmos MOLECULE = C_u, NUMBER_TO_RELEASE = num_u / 2 } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz /* reactions (7) - (12) */ case14 OBJECT { kosmos OBJECT little_box {} release_site_r1 RELEASE_SITE { SHAPE = case14.kosmos MOLECULE = D_u, NUMBER_TO_RELEASE = num_u } release_site_r2 RELEASE_SITE { SHAPE = case14.kosmos MOLECULE = E_u, NUMBER_TO_RELEASE = num_u } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz /* reactions (13) - (18) */ case15 OBJECT { kosmos OBJECT little_box {} release_site_r1 RELEASE_SITE { SHAPE = case15.kosmos MOLECULE = F_u, NUMBER_TO_RELEASE = num_u } release_site_r2 RELEASE_SITE { SHAPE = case15.kosmos MOLECULE = G_u, NUMBER_TO_RELEASE = num_u } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz /* reactions (19) - (22) */ case16 OBJECT { kosmos OBJECT little_box {} release_site_r1 RELEASE_SITE { SHAPE = case16.kosmos MOLECULE = A_b, NUMBER_TO_RELEASE = num_b/2 } release_site_r2 RELEASE_SITE { SHAPE = case16.kosmos MOLECULE = C_b, NUMBER_TO_RELEASE = num_b/2 } release_site_r3 RELEASE_SITE { SHAPE = case16.kosmos MOLECULE = D_b, NUMBER_TO_RELEASE = num_b/2 } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz /* reactions (23) - (26) */ case17 OBJECT { kosmos OBJECT little_box {} release_site_r1 RELEASE_SITE { SHAPE = case17.kosmos MOLECULE = E_b, NUMBER_TO_RELEASE = num_b / 2 } release_site_r2 RELEASE_SITE { SHAPE = case17.kosmos MOLECULE = F_b, NUMBER_TO_RELEASE = num_b / 2 } release_site_r3 RELEASE_SITE { SHAPE = case17.kosmos MOLECULE = G_b, NUMBER_TO_RELEASE = num_b / 2 } TRANSLATE = [x, 0, 0] } x = x + 2*boxdims + fuzz xright = x + boxdims PARTITION_X = [ [ xleft TO xright STEP 0.025 ] ] PARTITION_Y = [ [ -boxdims-fuzz TO boxdims+fuzz STEP 0.025 ] ] PARTITION_Z = [ [ -boxdims-fuzz TO boxdims+fuzz STEP 0.025 ] ] INSTANTIATE multiverse OBJECT { b1 OBJECT case1 {} b2 OBJECT case2 {} b3 OBJECT case3 {} b4 OBJECT case4 {} b5 OBJECT case5 {} b9 OBJECT case9 {} b10 OBJECT case10 {} b11 OBJECT case11 {} b12 OBJECT case12 {} b13 OBJECT case13 {} b14 OBJECT case14 {} b15 OBJECT case15 {} b16 OBJECT case16 {} b17 OBJECT case17 {} } REACTION_DATA_OUTPUT { OUTPUT_BUFFER_SIZE = 50 STEP = timestep*10 HEADER = "# " { COUNT[S_u,WORLD] : "S_u", COUNT[S_b1,WORLD] : "S_b1", COUNT[S_b2,WORLD] : "S_b2", COUNT[S_b3,WORLD] : "S_b3", COUNT[S_b4to,WORLD] : "S_b4", COUNT[S_bt1,WORLD] : "S_bt1", COUNT[S_bt2,WORLD] : "S_bt2", COUNT[S_bt3,WORLD] : "S_bt3", COUNT[S_bt4to,WORLD] : "S_bt4", COUNT[V_b1,WORLD] : "V_b1", COUNT[S_vb2,WORLD] : "S_vb2", COUNT[V_bt1,WORLD] : "V_bt1", COUNT[S_vbt2,WORLD] : "S_vbt2", COUNT[V_b3,WORLD] : "V_b3", COUNT[S_vb4to,WORLD] : "S_vb4", COUNT[V_bt3,WORLD] : "V_bt3", COUNT[S_vbt4to,WORLD] : "S_vbt4", COUNT[B_u,WORLD] : "B_u", COUNT[B_b,WORLD] : "B_b", COUNT[B_b2,WORLD] : "B_b2", COUNT[B_bt,WORLD] : "B_bt", COUNT[B_bt2,WORLD] : "B_bt2", COUNT[B_vb,WORLD] : "B_vb", COUNT[B_vbt,WORLD] : "B_vbt", COUNT[B_vb2,WORLD] : "B_vb2", COUNT[B_vbt2,WORLD] : "B_vbt2" } => countdir & "V_out.dat" { COUNT[fwd_u,WORLD] : "fwd_u", COUNT[fwd_b,WORLD] : "fwd_b", COUNT[fwd_bt,WORLD] : "fwd_bt", COUNT[fwd_b2,WORLD] : "fwd_b2", COUNT[fwd_bt2,WORLD] : "fwd_bt2", COUNT[fwd_vb,WORLD] : "fwd_vb", COUNT[fwd_vbt,WORLD] : "fwd_vbt", COUNT[fwd_vb2,WORLD] : "fwd_vb2", COUNT[fwd_vbt2,WORLD] : "fwd_vbt2", COUNT[rev_u,WORLD] : "rev_u", COUNT[rev_b,WORLD] : "rev_b", COUNT[rev_bt,WORLD] : "rev_bt", COUNT[rev_b2,WORLD] : "rev_b2", COUNT[rev_bt2,WORLD] : "rev_bt2", COUNT[rev_vb,WORLD] : "rev_vb", COUNT[rev_vbt,WORLD] : "rev_vbt", COUNT[rev_vb2,WORLD] : "rev_vb2", COUNT[rev_vbt2,WORLD] : "rev_vbt2" } => countdir & "rxn_out.dat" { COUNT[A_u,WORLD] : "A_u", COUNT[C_u,WORLD] : "C_u" } => countdir & "b13_u_out.dat" { COUNT[fwd_AC_u1,WORLD] : "fwd_AC_u1", COUNT[rev_AC_u1,WORLD] : "rev_AC_u1", COUNT[fwd_AC_u2,WORLD] : "fwd_AC_u2", COUNT[rev_AC_u2,WORLD] : "rev_AC_u2", COUNT[fwd_AC_u3,WORLD] : "fwd_AC_u3", COUNT[rev_AC_u3,WORLD] : "rev_AC_u3" } => countdir & "b13_u_rxn_out.dat" { COUNT[D_u,WORLD] : "D_u", COUNT[E_u,WORLD] : "E_u" } => countdir & "b14_u_out.dat" { COUNT[fwd_DE_u1,WORLD] : "fwd_DE_u1", COUNT[rev_DE_u1,WORLD] : "rev_DE_u1", COUNT[fwd_DE_u2,WORLD] : "fwd_DE_u2", COUNT[rev_DE_u2,WORLD] : "rev_DE_u2", COUNT[fwd_DE_u3,WORLD] : "fwd_DE_u3", COUNT[rev_DE_u3,WORLD] : "rev_DE_u3" } => countdir & "b14_u_rxn_out.dat" { COUNT[F_u,WORLD] : "F_u", COUNT[G_u,WORLD] : "G_u" } => countdir & "b15_u_out.dat" { COUNT[fwd_FG_u1,WORLD] : "fwd_FG_u1", COUNT[rev_FG_u1,WORLD] : "rev_FG_u1", COUNT[fwd_FG_u2,WORLD] : "fwd_FG_u2", COUNT[rev_FG_u2,WORLD] : "rev_FG_u2", COUNT[fwd_FG_u3,WORLD] : "fwd_FG_u3", COUNT[rev_FG_u3,WORLD] : "rev_FG_u3" } => countdir & "b15_u_rxn_out.dat" { COUNT[fwd_AC_b1,WORLD] : "fwd_AC_b1", COUNT[fwd_AC_b2,WORLD] : "fwd_AC_b2", COUNT[fwd_AC_b3,WORLD] : "fwd_AC_b3" } => countdir & "b16_b_rxn_out.dat" { COUNT[fwd_EF_b1,WORLD] : "fwd_EF_b1", COUNT[fwd_EF_b2,WORLD] : "fwd_EF_b2", COUNT[fwd_EF_b3,WORLD] : "fwd_EF_b3" } => countdir & "b17_b_rxn_out.dat" }