physics.hpp 2.2 KB

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