File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88from dolfinx import fem , io
99
1010from festim .helpers import get_interpolation_points
11+ from festim import k_B as _k_B
1112from festim .species import Species
1213from festim .subdomain .volume_subdomain import VolumeSubdomain
1314from festim .reaction import Reaction
@@ -331,11 +332,14 @@ def __init__(
331332 subdomain : VolumeSubdomain | None = None ,
332333 checkpoint : bool = False ,
333334 ):
334- # for example
335- def expression (T , c_a , c_b , c_c ):
336- return reaction .reaction_term (
337- T , reactant_concentrations = [c_a , c_b ], product_concentrations = [c_c ]
338- )
335+ def expression (T , reactants , products ):
336+ k = reaction .k_0 * ufl .exp (- reaction .E_k / (_k_B * T ))
337+ if reaction .p_0 and reaction .E_p :
338+ p = reaction .p_0 * ufl .exp (- reaction .E_p / (_k_B * T ))
339+ elif reaction .p_0 :
340+ p = reaction .p_0
341+
342+ return k * ufl .product (reactants ) - p * ufl .product (products )
339343
340344 super ().__init__ (
341345 filename = filename ,
You can’t perform that action at this time.
0 commit comments