physics.hpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef PHYSICS_HPP
  2. #define PHYSICS_HPP
  3. #include <cmath>
  4. #include <cassert>
  5. enum PhysicModel{BrooksCorey};
  6. //! The Physics class contains all physical parameters characterising the soil.
  7. class Physics{
  8. public:
  9. //! Physics constructor
  10. Physics(PhysicModel model);
  11. //! Gravity acceleration (m.s^-2)
  12. double g;
  13. //! Fluid density (g.l^(-1))
  14. double rho;
  15. //! Porosity of the soil
  16. double phi;
  17. //! Conductivity of the saturated soil
  18. double k0;
  19. //! Characterise the water pressure at the bottom of the overland water
  20. double nivrivsat;
  21. //! Return the saturation in function of the pressure
  22. double (*s)(double);
  23. //! Return the derivtive of the saturation in function of the pressure
  24. double (*ds)(double);
  25. //! Set the saturation and its derivative in function of the pressure
  26. void (*s_ds)(double,double&,double&);
  27. //! Return the relative conductivity in function of the pressure
  28. double (*kr)(double);
  29. //! Return the derivtive of the relative conductivity in function of the pressure
  30. double (*dkr)(double);
  31. //! Set the relative conductivity and its derivative in function of the pressure
  32. void (*kr_dkr)(double,double&,double&);
  33. //---------------------
  34. // Models descriptions
  35. //---------------------
  36. //! Datas used to define the model
  37. static double model_datas[6];
  38. //------------------------
  39. // Brooks and Corey model
  40. //------------------------
  41. //model_datas[0] -> psat : minimal pressure such that s(psat)=1
  42. //model_datas[1] -> sres : residual pressure
  43. //model_datas[2] -> lambda
  44. //model_datas[3] -> alpha
  45. //! Brooks and Corey saturation map
  46. static double s_BC(double P);
  47. //! Brooks and Corey derivative of the saturation map
  48. static double ds_BC(double P);
  49. //! Brooks and Corey saturation and its derivative setter
  50. static void (s_ds_BC)(double P,double& v,double& dv);
  51. //! Brooks and Corey relative conductivity map
  52. static double kr_BC(double P);
  53. //! Brooks and Corey derivative of the relative conductivity map
  54. static double dkr_BC(double P);
  55. //! Brooks and Corey relative conductivity and its derivative setter
  56. static void (kr_dkr_BC)(double P,double& v,double& dv);
  57. };
  58. #endif