关于化学反应带来的质量源项的udf编写
-
各位大哥们,最近在模拟一个液固催化反应过程,液体反应物传质到固体催化剂中然后进行反应。在给固相编写源项udf的时候,发现如果直接用C_YI(c, t, 0)来获取浓度,得到的是在固相的浓度。而文献通常所写的反应速度R=k·c1·c2,这里的浓度c都是液相的浓度。在网上和官方手册上也找了一些例子,但是发现好像都不涉及多相流,都是直接获取反应所在相的浓度来计算速度。
好像不管 DEFINE_SOURCE 还是 REACTION_RATE,都没有对主次流动相的指针,这种情况应该怎么去获取物种在另一个相的浓度呢?
有大哥知道应该怎么解决吗?感激不尽! -
有一节叫Advanced Multiphase Macro,也许有帮助。
For most standard UDFs written for multiphase models (for example, source term, material property, profile functions), variables that your function needs (domain pointers, thread pointers, and so on) are passed directly to your UDF as arguments by the solver in the solution process. All you need to do is hook the UDF to your model and everything is taken care of. For example, if your multiphase UDF defines a custom profile for a particular boundary zone (using DEFINE_PROFILE) and is hooked to the appropriate phase or mixture in Ansys Fluent in the relevant boundary condition dialog box, then appropriate phase or mixture variables will be passed to your function by the solver at run time.
There may, however, be more complex functions you want to write that require a variable that is not directly passed through its arguments. DEFINE_ADJUST and DEFINE_INIT functions, for example, are passed mixture domain variables only. If a UDF requires a phase domain pointer, instead, then it will need to use macros presented in this section to retrieve it. ON_DEMAND UDFS are not directly passed any variables through their arguments. Consequently, any on demand function that requires access to phase or domain variables will also need to use macros presented in this section to retrieve them.