Droplet Lagrangian Transient One-dimensional Reacting Code Implementation of both liquid and gas phase governing equations.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.5KB

  1. #ifndef SUNDIALS_DEF
  2. #define SUNDIALS_DEF
  3. #include <sundials/sundials_types.h>
  4. #include <nvector/nvector_openmp.h>
  5. #endif
  6. #ifndef PRINT_DEF
  7. #define PRINT_DEF
  8. #include <string.h> //for strings
  9. #include <stdio.h> //for printf,scanf
  10. #include <stdlib.h> //for atoi, atof
  11. #endif
  12. #ifndef CANTERA_DEF
  13. #define CANTERA_DEF
  14. #include <cantera/IdealGasMix.h>
  15. #include <cantera/transport.h>
  16. #endif
  17. #include "UserData.h"
  18. double maxTemperaturePosition(const double* y,const size_t nt,const size_t nvar,const double* x ,size_t nPts);
  19. double maxTemperature(const double* y,const size_t nt, const size_t nvar, size_t nPts);
  20. int maxTemperatureIndex(const double* y,const size_t nt,const size_t nvar ,size_t nPts);
  21. double maxCurvPositionR(const double* y, const size_t nt,
  22. const size_t nvar, const size_t nr, size_t nPts);
  23. int maxCurvIndexR(const double* y, const size_t nt,
  24. const size_t nvar, const size_t nr, size_t nPts);
  25. double maxGradPosition(const double* y, const size_t nt,
  26. const size_t nvar, const double* x, size_t nPts);
  27. int maxGradIndex(const double* y, const size_t nt,
  28. const size_t nvar, const double* x, size_t nPts);
  29. double maxCurvPosition(const double* y, const size_t nt,
  30. const size_t nvar, const double* x, size_t nPts);
  31. int maxCurvIndex(const double* y, const size_t nt,
  32. const size_t nvar, const double* x, size_t nPts);
  33. double isothermPosition(const double* y, const double T, const size_t nt,
  34. const size_t nvar, const double* x, const size_t nPts);
  35. int setAlgebraicVariables(N_Vector *id,UserData data);
  36. inline double calc_area(double x,int* i);
  37. void updateSolution(double* y, double* ydot, const size_t nvar,
  38. const double xOld[],const double xNew[],const size_t npts);
  39. void readInitialCondition(FILE* input, double* ydata, const size_t nvar, const size_t nr, const size_t nPts);
  40. double systemMass(double* ydata, UserData data);
  41. int initializePsiGrid(double* ydata, double* psidata, UserData data);
  42. int setInitialCondition(N_Vector* y,
  43. N_Vector* ydot,
  44. UserData data);
  45. inline void setGas(UserData data, double *ydata, size_t gridPoint);
  46. void getTransport(UserData data,
  47. double *ydata,
  48. size_t gridPoint,
  49. double *rho,
  50. double *lambda,
  51. double *YV);
  52. int residue(double t,
  53. N_Vector y,
  54. N_Vector ydot,
  55. N_Vector res,
  56. void *user_data);
  57. void trackFlameOH(N_Vector y,UserData data);
  58. void trackFlame(N_Vector y,UserData data);
  59. size_t BathGasIndex(UserData data);
  60. size_t oxidizerIndex(UserData data);
  61. inline double Qdot(double* t,
  62. double* x,
  63. double* ignTime,
  64. double* kernelSize,
  65. double* maxQdot);
  66. void printSpaceTimeHeader(UserData data);
  67. void printSpaceTimeOutput(double t, N_Vector* y, FILE* output, UserData data);
  68. void printSpaceTimeRates(double t, N_Vector ydot, UserData data);
  69. void printGlobalHeader(UserData data);
  70. void printGlobalVariables(double t, N_Vector* y, N_Vector* ydot, UserData data);
  71. void printSpaceTimeOutputInterpolated(double t, N_Vector y, UserData data);
  72. void writeRestart(double t, N_Vector* y, N_Vector* ydot, FILE* output, UserData data);
  73. void readRestart(N_Vector* y, N_Vector* ydot, FILE* input, UserData data);
  74. void getTimescale(UserData data, N_Vector* y);
  75. void printTimescaleHeader(UserData data);
  76. void printTimescaleOutput(double t,N_Vector* y,FILE* output,UserData data);
  77. void floorSmallValue(UserData data, N_Vector* y);
  78. void resetTolerance(UserData data, N_Vector* y,N_Vector* atolv);