Droplet Lagrangian Transient One-dimensional Reacting Code Implementation of both liquid and gas phase governing equations.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

macros.h 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef MACRO_DEF
  2. #define MACRO_DEF
  3. //#define SUNDIALS_DOUBLE_PRECISION 1
  4. //#define SUNDIALS_SINGLE_PRECISION 1
  5. #define ZERO RCONST(0.0)
  6. #define HALF RCONST(0.5)
  7. #define ONE RCONST(1.0)
  8. #define TWO RCONST(2.0)
  9. #define THREE RCONST(3.0)
  10. #define FOUR RCONST(4.0)
  11. #define TEN RCONST(10.0)
  12. #define ONE_ATM RCONST(101325.0)
  13. /* In order to keep begin the index numbers from 1 instead of 0, we define
  14. * macros here. Also, we define macros to ease referencing various variables in
  15. * the sundials nvector.
  16. */
  17. #define WORK(i) WORK[i-1]
  18. #define XNEW(i) XNEW[i-1]
  19. #define psi(i) psidata[i-1]
  20. #define T(i) ydata[((i-1)*data->nvar)+data->nt]
  21. #define Y(i,k) ydata[((i-1)*data->nvar)+data->ny+k-1]
  22. #define R(i) ydata[((i-1)*data->nvar)+data->nr]
  23. #define P(i) ydata[((i-1)*data->nvar)+data->np]
  24. #define Mdot(i) ydata[((i-1)*data->nvar)+data->nm]
  25. #define Tdot(i) ydotdata[((i-1)*data->nvar)+data->nt]
  26. #define Ydot(i,k) ydotdata[((i-1)*data->nvar)+data->ny+k-1]
  27. #define Rdot(i) ydotdata[((i-1)*data->nvar)+data->nr]
  28. #define Pdot(i) ydotdata[((i-1)*data->nvar)+data->np]
  29. #define Mdotdot(i) ydotdata[((i-1)*data->nvar)+data->nm]
  30. #define Tres(i) resdata[((i-1)*data->nvar)+data->nt]
  31. #define Yres(i,k) resdata[((i-1)*data->nvar)+data->ny+k-1]
  32. #define Rres(i) resdata[((i-1)*data->nvar)+data->nr]
  33. #define Pres(i) resdata[((i-1)*data->nvar)+data->np]
  34. #define Mdotres(i) resdata[((i-1)*data->nvar)+data->nm]
  35. #define Tid(i) iddata[((i-1)*data->nvar)+data->nt]
  36. #define Yid(i,k) iddata[((i-1)*data->nvar)+data->ny+k-1]
  37. #define Rid(i) iddata[((i-1)*data->nvar)+data->nr]
  38. #define Pid(i) iddata[((i-1)*data->nvar)+data->np]
  39. #define Mdotid(i) iddata[((i-1)*data->nvar)+data->nm]
  40. #define Yav(i) Yav[i-1]
  41. #define YAvg(i) YAvg[i-1]
  42. #define YVmhalf(i) YVmhalf[i-1]
  43. #define YVphalf(i) YVphalf[i-1]
  44. #define X(i) X[i-1]
  45. #define Xp(i) Xp[i-1]
  46. #define Xgradhalf(i) Xgradhalf[i-1]
  47. #define XLeft(i) XLeft[i-1]
  48. #define XRight(i) XRight[i-1]
  49. #define gradX(i) gradX[i-1]
  50. #define wdot(i) wdot[i-1]
  51. #define enthalpy(i) enthalpy[i-1]
  52. #define energy(i) energy[i-1]
  53. #define Cp(i) Cp[i-1]
  54. #define atolT(i) atolvdata[((i-1)*data->nvar)+data->nt]
  55. #define atolY(i,k) atolvdata[((i-1)*data->nvar)+data->ny+k-1]
  56. #define atolR(i) atolvdata[((i-1)*data->nvar)+data->nr]
  57. #define atolP(i) atolvdata[((i-1)*data->nvar)+data->np]
  58. #define atolMdot(i) atolvdata[((i-1)*data->nvar)+data->nm]
  59. #define constraintsY(i,k) constraintsdata[((i-1)*data->nvar)+data->ny+k-1]
  60. #define constraintsR(i) constraintsdata[((i-1)*data->nvar)+data->nr]
  61. /*Following marcos are defined to calculate the characteristic time-scale */
  62. #define wdot_mole(i) wdot_mole[i-1]
  63. #define wdot_mass(i) wdot_mass[i-1]
  64. #define MW(i) MW[i-1]
  65. #define time_scale(i,k) time_scale[(i-1)*data->nsp+k-1]
  66. #define concentra(i) concentra[i-1]
  67. #endif