Beyond and side by side with numerics

439 views

Published on

This discusses the fact that one as to solve the right equations for a problem and show some interesting cases which consist in modifications of the Richards' equation. These equations, in turns, require special methods to be solved, and the right equations are useless without the appropriate numerics. The second part of the talk discusses the how equations are not the whole picture in a research or technical environment. Several other conditions need to be met.

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
439
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Beyond and side by side with numerics

  1. 1. Beyond and side by side withnumerics -IRiccardo RigonDance,HenryMatisse,HotelBironearly1909Wednesday, April 24, 13
  2. 2. They started from wrongassumptions, and applying aperfect logic, they arrivedrigorously to wrong results.My father in lawWednesday, April 24, 13
  3. 3. 3I am here to tell you aboutWhat are the central topics of the work of the modellers•Find the right equationsIntroduzioneR. Rigon•Find the right numerical methodsWednesday, April 24, 13
  4. 4. 4Are Richards’ equation right ?Well, they represents mass conservation: and this is a basic principleHoweverWhat happens when soil turns to saturation ?What happens when soil freezes ?What happens when warms, goofers or roots escavate the soil ?Richards ++R. RigonWednesday, April 24, 13
  5. 5. 5What I mean with Richards ++First, I would say, it means that it would be better to call it, forinstance: Richards-Mualem-vanGenuchten equation, since it is:Se = [1 + ( ⇥)m)]nSe :=w r⇥s rC(⇥)⇤⇥⇤t= ⇥ · K( w) ⇥ (z + ⇥)⇥K( w) = Ks⇧Se⇤1 (1 Se)1/m⇥m⌅2C(⇥) :=⇤ w()⇤⇥Richards ++R. Rigon and E. CordanoWednesday, April 24, 13
  6. 6. 5What I mean with Richards ++First, I would say, it means that it would be better to call it, forinstance: Richards-Mualem-vanGenuchten equation, since it is:Se = [1 + ( ⇥)m)]nSe :=w r⇥s rC(⇥)⇤⇥⇤t= ⇥ · K( w) ⇥ (z + ⇥)⇥K( w) = Ks⇧Se⇤1 (1 Se)1/m⇥m⌅2Water balanceC(⇥) :=⇤ w()⇤⇥Richards ++R. Rigon and E. CordanoWednesday, April 24, 13
  7. 7. 5What I mean with Richards ++First, I would say, it means that it would be better to call it, forinstance: Richards-Mualem-vanGenuchten equation, since it is:Se = [1 + ( ⇥)m)]nSe :=w r⇥s rC(⇥)⇤⇥⇤t= ⇥ · K( w) ⇥ (z + ⇥)⇥K( w) = Ks⇧Se⇤1 (1 Se)1/m⇥m⌅2Water balanceParametricMualemC(⇥) :=⇤ w()⇤⇥Richards ++R. Rigon and E. CordanoWednesday, April 24, 13
  8. 8. 5What I mean with Richards ++First, I would say, it means that it would be better to call it, forinstance: Richards-Mualem-vanGenuchten equation, since it is:Se = [1 + ( ⇥)m)]nSe :=w r⇥s rC(⇥)⇤⇥⇤t= ⇥ · K( w) ⇥ (z + ⇥)⇥K( w) = Ks⇧Se⇤1 (1 Se)1/m⇥m⌅2Water balanceParametricMualemParametricvan GenuchtenC(⇥) :=⇤ w()⇤⇥Richards ++R. Rigon and E. CordanoWednesday, April 24, 13
  9. 9. 6What happens whenIn terms of soil water content, it cannot becomelarger than porosity (if the matrix is consideredrigid).At the transition with saturationR. Rigon and E. CordanoWednesday, April 24, 13
  10. 10. 7What I mean with Richards ++Extending Richards to treat the transition saturated to unsaturated zone.Which means:At the transition with saturationR. Rigon and E. CordanoWednesday, April 24, 13
  11. 11. 8So we switch to a generalisedgroundwater equationswhich has been obtained by modifying the SWRCAt the transition with saturationR. Rigon and E. CordanoWednesday, April 24, 13
  12. 12. 9What about soil freezing ?In terms of soil water content, it cannot becomelarger than porosity (if the matrix is consideredrigid).Soil FreezingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  13. 13. 10dS(U, V, M) = 0first principlepotentialenergykineticenergyinternalenergyenergy fluxes atthe boundariessecond principlethe equilibrium relation becomes:(But they are not 2 equations. The second is just a restriction on thefirst ). Assuming:K( ) = 0 ; P( ) = 0 ; ( ) = 0Which equations ?Soil FreezingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  14. 14. 11Uc( ) := Uc(S, V, A, M)dUc(S, V, A, M)dt=⇥Uc( )⇥S⇥S⇥t+⇥Uc( )⇥V⇥V⇥t+⇥Uc( )⇥A⇥A⇥t+⇥Uc( )⇥M⇥M⇥tInternal Energyentropy areavolume massIndependent variablesTo find how the equations aremodified we go to the basicsSoil FreezingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  15. 15. 12Expression Symbol Name of the dependent variable⇤SUc T temperature- ⇤V Uc p pressure⇤AUc surface energy⇤M Uc µ chemical potentialTo find how the equations aremodified we go to the basicsSo the equation for each phase is:Soil FreezingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  16. 16. 13dS( ) =1Tw1Ti⇥dUw( ) +pwTwpiTi⇥dVw( )µw( )Twµi( )Ti⇥dMw = 0⇤⇥Ti = Twpi = pwµi = µwthe equilibrium relationbecomes:Flat interfaces at equilibrium** The derivation is not so straightforward and implies the use of Lagrange multipliers. See Muller and Weiss,2005Water FreezingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  17. 17. 14first principlepotentialenergykineticenergyinternalenergyenergy fluxes atthe boundariessecond principlebut:(But they are not 2 equations. The second is just a restriction on thefirst ). Assume:Let’s condsider a disequilibrium processSoil Freezing equationsR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  18. 18. 15Dirichlet Boundary ConditionsDirichlet Boundary ConditionsThe Stefan problemThe Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  19. 19. 16Ice (thermal conductivity,thermal capacity)Water (thermal conductivity,thermal capacity)The Stefan problemThe Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  20. 20. 17Diffusion of heat through waterThe Stefan problemDiffusion of heat through iceThe Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  21. 21. 18Different condition at the interfaceThe Stefan problemThe Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  22. 22. 19⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⇤⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⇥v1 = v2 = Tref (t > 0, z = Z(t))v2 ⇥ Ti (t > 0, z ⇥ ⇤)v1 = Ts (t > 0, z = 0)⇥1v1z ⇥2v2z = Lf ⇤w sdZ(t)dt (t > 0, z = Z(t))v1t = k12v1z2 (t > 0, z < Z(t))v2t = k22v2z2 (t > 0, z > Z(t))v1 = v2 = Ti (t = 0, z)Freezing case (1Ddiscretization)Equations of the Stefan ProblemThe Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  23. 23. 20• Moving boundary condition between the two phases,where heat is liberated or absorbed• Thermal properties of the two phases may be differentThe Stefan ProblemThe Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  24. 24. 21⌅⌅⇤⌅⌅⇥v1(t, z) = Ts +Tref Tserf · erf z2⇥k1 tif z ⇤ Z(t)v2(t, z) = TiTi Treferfc“ qk1k2” · erfc z2⇥k2 tif z > Z(t)⌅⌅⇤⌅⌅⇥v1(t, z) = TiTi Treferfc“ qk2k1” · erfc z2⇥k1 tif z > Z(t)v2(t, z) = Ts +Tref Tserf · erf z2⇥k2 tif z ⇤ Z(t)where ζ is the solution of:Freezing case:exp( 2)· erf⇤T 1⇤k2 (Ti Tref )⇤T 2⇤k1 (Tref Ts) · erfc⇧k2k1⇥ · exp⇤k2k12⌅=Lf ⇧w ⇥s⇤⌅CT 2 (Tref Ts)where ζ is the solution of:Thawing case:exp( 2)· erf⇤T 2⇤k1 (Ti Tref )⇤T 1⇤k2 (Tref Ts) · erfc⇧k1k2⇥ · exp⇤k1k22⌅=Lf ⇧w ⇥s⇤⌅CT 1 (Tref Ts)The Stefan Problem: analitic solutionsThe Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  25. 25. 22Well, the real case is a little more complicateR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  26. 26. 23Water is•often in unsaturated conditions•in pores•it is known that it does not freeze until verynegative temperatures are obtainedBeyond the Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  27. 27. 24Unsaturated conditions•Means that capillary forces acts, i.e. we have toaccount for the tension forces that accumulate incurves surfacesBeyond the Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  28. 28. 25pw = pa wa⇤Awa(r)⇤Vw(r)= pa wa⇤Awa/⇤r⇤Vw/⇤r= pa wa2r:= pa pwa(r)Young-Laplace equationpapwthe equilibrium condition:becomes:What does it means unsaturated conditionsBeyond the Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  29. 29. 26⇤dpdT=sw( ) si( )vw( ) vi( )=hw( ) hi( )T [vw( ) vi( )]⇥Lf ( )T [vw( ) vi( )]where Lf = 333000 J/Kg is the latent heat of fusionClausius-Clapeyron equationBeyond the Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  30. 30. 27A paradox ?Water inside a capillary is at a lower pressure than atmosphere.Therefore it should freeze before (lower the pressure, higher the freezingtemperature.Beyond the Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  31. 31. 28A paradox ?Instead what happens is exactly the contrary, because for freezing a nucleus ofcondensation has to occurrwith r << rBeyond the Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  32. 32. 29So, actuallyThe situation at the freezing point is the opposite, and represented by theblue arrowFreezing point depressionBeyond the Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  33. 33. 30Because,the smaller the pores,the larger the freezing point depressionlarger poresfreezes before thansmaller poresBeyond the Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  34. 34. 31Becauseby means of the Clausius-Clapeyron equationthere is a one-to-one relations between thesize of the pores and the temperaturedepression, and because there isalso a one-to-one relationship between thesize of the pores and the pressurethere is a one-one relation among T andBeyond the Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  35. 35. 32UnsaturatedunfrozenUnsaturatedFrozenFreezingstartsFreezingprocedesBeyond the Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  36. 36. 33pw0 = pa wa⇥Awa(r0)⇥Vw= pa pwa(r0) pi = pa ia⇥Aia(r0)⇥Vw:= pa pia(r0)pw1 = pa ia⇥Aiar(0)⇥Vwiw⇥Aiw(r1)⇥VwTwo interfaces (air-ice and water-ice) should be considered!!!Curved interfaces with three phasesBeyond the Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  37. 37. 34Nowwe have enough information to write the rightequationsPerhapsBeyond the Stefan problemR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  38. 38. 35A further assuptionTo make it manageable, we do a further assuption. Mainly the freezing=dryingassuption.Considering the assumption “freezing=drying” (Miller, 1963) the ice “behaveslike air” and does not add furhter pressure termsFreezing = DryingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  39. 39. 36pw1 = pw0 + pfreezFreezing = DryingFreezing = DryingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  40. 40. 37Unfrozen water contentsoil waterretention curvethermodynamicequilibrium (Clausius Clapeyron)+⇥w =pww gpressure head:w(T) = w [⇥w(T)]How this reflects on pressure headFreezing = DryingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  41. 41. 38w =sAw |⇥| + 1⇥w = ⇥r + (⇥s ⇥r) · {1 + [ (⇤)]n}mmaxw = s ·Lf (T Tm)g T ⇥sat⇥-1/bClapp andHornberger(1978)Luo et al. (2009), Niu andYang (2006), Zhang et al.(2007)Gardner (1958) Shoop and Bigl (1997)Van Genuchten(1980) Hansson et al (2004)How this reflects on pressure headFreezing = DryingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  42. 42. 39UnsaturatedunfrozenUnsaturatedFrozenFreezingstartsFreezingprocedesSoil water retention curvesFreezing = DryingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  43. 43. 40−0.05 −0.04 −0.03 −0.02 −0.01 0.000.10.20.30.4Unfrozen water contenttemperature [C]Theta_u[−]psi_m −5000psi_m −1000psi_m −100psi_m 0iceairwater...T := T0 +g T0Lfw0T* at various saturation contents= ⇥r + (⇥s ⇥r) · {1 + [ · ⇤w0]n}mice content: i =⇥w⇥iw⇥⇥w = ⇥r + (⇥s ⇥r) ·⇤1 + ⇤w0Lfg T0(T T⇥) · H(T T⇥)⇥n⌅ mliquid water content:Total water content:depressedmelting pointSoil water retention curvesFreezing = DryingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  44. 44. 41Soil water retention curvesFreezing = DryingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  45. 45. 42Soil water retention curvesFreezing = DryingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  46. 46. 43-3 -2 -1 0 10.00.20.40.60.81.0n=1.5temperature [C]theta_w/theta_s[-]psi_w0=0 psi_w0=-1000alpha=0.001 [1/mm]alpha=0.01 [1/mm]alpha=0.1 [1/mm]alpha=0.4 [1/mm]-10000 -8000 -6000 -4000 -2000 00.00.20.40.60.81.0n=1.5psi_w0 [mm]theta_w/theta_s[-]T=2 T=-2alpha=0.001 [1/mm]alpha=0.01 [1/mm]alpha=0.1 [1/mm]alpha=0.4 [1/mm]T > 0[mm 1]n 0.001 0.01 0.1 0.41.1 0.939 0.789 0.631 0.5491.5 0.794 0.313 0.099 0.0492.0 0.707 0.099 0.009 0.0022.5 0.659 0.032 0.001 1.2E-4T = 2 ⇥C[mm 1]n 0.001 0.01 0.1 0.41.1 0.576 0.457 0.363 0.3161.5 0.063 0.020 0.006 0.0032.0 4E-3 4E-4 4E-5 1E-52.5 2.5E-4 8E-6 2.5E-7 3.2E-825θw/θs at ψw0=−1000 [mm]Playing with Van GenucthenFreezing = Drying - NumbersR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  47. 47. 44⇤⇤tflw (⇥w1)⇥⇤ •⇤KH⇤ ⇥w1 + KH⇤ zf⌅+ Sw = 0Liquid water may derive fromice melting: ∆θphwater flux: ∆θflVolume conservation:⇤⌃⇧⌃⌅0 ⇥ r ⇥ ⇥ ⇥ s ⇥ 1r⌥w0 + i0 + 1 iw⇥phi ⇥ flw ⇥ s⌥w0 + i0 + 1 iw⇥phiMass conservation (Richards, 1931) equation:Richards’ equationEquation of freezingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  48. 48. 45U = Cg(1 s) T + ⇥wcw w T + ⇥ici i T + ⇥wLf wUt+ ⌥⇥ • ( ⌥G + ⌥J) + Sen = 0⌃G = T (⇥w0, T) · ⌃⇤TJ = w · Jw(⇥w0, T) · [Lf + cw T]0 assuming freezing=dryingU = hgMg + hwMw + hiMi (pwVw + piVi) + µwMphw + µiMphino expansion: ρw=ρiassuming:0no flux during phase changeEventually:0 assuming equilibrium thermodynamics:µw=µi and Mwph = -MiphconductionadvectionEnergy EquationEquation of freezingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  49. 49. 46dUdt= CTdTdt+ ⇥w (cw ci) · T + Lf⇥⇤ w⇤t⇤ w [⇥w1(T)]⇤t=⇤ w⇤⇥w1·⇤⇥w1⇤T·⇤T⇤t= CH(⇥w1) ·⇤⇥freez⇤T·dTdtdUdt=⇤CT + w Lf + (cw ci) · T⇥· CH(T) ·⇤⇥freez(T)⇤T⌅·dTdt-3 -2 -1 0 1020406080100140alpha= 0.01 [1/mm] n= 1.5 theta_s= 0.4Temp. [ C]U[MJ/m3]psi_w0=0psi_w0=-100psi_w0=-1000psi_w0=-10000-3 -2 -1 0 1alpha= 0.01 [1/mm] n= 1.5 C_g= 2300000 [J/m3 K]Temp. [ C]C_a[MJ/m3K]1e+011e+021e+03psi_w0=0 psi_w0=-1000theta_s= 0.02theta_s= 0.4theta_s= 0.8{CappAppearent Heat CapacityEquation of freezingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  50. 50. 47⇤⌃⇧⌃⌅⇤U( w0,T )⇤t⇤⇤z ⇥T (⇤w0, T) · ⇤T⇤z J(⇤w0, T)⇥+ Sen = 0⇤ ( w0)⇤t⇤⇤z⌥KH(⇤w0, T) · ⇤ w1( w0,T )⇤z KH cos + Sw = 01Drepresentation:Finally the “right” equationsEquation of freezingR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  51. 51. 48GEOtop solver of freezing equationsR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  52. 52. 49The right numerical methodsNotes on numericsR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  53. 53. 50• Finite difference discretization, semi-implicit Crank-Nicholsonmethod;• Conservative linearization of the conserved quantity (Celia et al,1990);• Linearization of the system through Newton-Raphson method;• when passing from positive to negative temperature, Newton-Raphson method is subject to big oscillations (Hansson et al,2004)Notes on numericsR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  54. 54. 51if ||⌅(⇥)m+1|| > ||⌅(⇥)m|| ⌅ ⌅⇥m+1⇤ ⌅⇥m ⌅⇥⇥ ·reduction factor δ with 0 ≤ δ ≤ 1.If δ = 1 the scheme is the normal Newton-Raphson schemeGlobally convergent Newton MethodNotes on numericsR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  55. 55. 52Limitations of the analytical solution:• homogeneous substance (pure water)• instant freezing/thawing at 0˚C• porosity=1• SFC (soil freezing characteristic curve)very steep (see VG parameters)GEOtopNotes on numerics of GEOtopR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  56. 56. 53real soil• constant Dirichlet conditions at the surface• no water movement (static conditions) • Richards is OFF-3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.50.00.20.40.60.81.0 temperature [C]Theta_u[-]modeled SFC for the comparisonreal SFCGEOtopNotes on numerics of GEOtopR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  57. 57. 54!5 !4 !3 !2 !1 0 1 2543210Temp [ C]soildepth[m]phase change: simulated and analytical solutionalpha= 0.4 n= 2.5 theta_s= 1 theta_r= 0sim an (day 0)sim an (day 15)sim an (day 30)sim an (day 45)sim an (day 60)sim an (day 75)time (days)T[C]−5−4−3−2−10120 15 30 45 60 75An GEOtopGEOtop Vs Analytical solutionalpha= 0.4 n= 2.5 theta_s= 10.02 m0.12 m0.22 m0.32 m0.42 m0.52 m0.62 m0.72 mOscillations: interface Z=Z(T=0,t) cannot move in a continuum as the analyticalsolution. Therefore the interface can be either on the cell i or on the cell i+1 butnot in between.GEOtopNotes on numerics of GEOtopR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  58. 58. 55time (days)T[C]!5!4!3!2!1012 0 15 30 45 60 75An GEOtopGEOtop Vs Analytical solution#layers= 100 , layer D= 200 mm, alpha= 0.4 n= 2.5 theta_s= 10.1 m0.3 m0.5 m0.8 m1.1 m1.5 m3 m4.5 mgrid size=300 mm grid size=200 mmtime (days)T[C]!5!4!3!2!10120 15 30 45 60 75An GEOtopGEOtop Vs Analytical solution#layers= 100 , layer D= 300 mm, alpha= 0.4 n= 2.5 theta_s= 10.15 m0.3 m0.5 m0.8 m1.1 m1.5 m3 m4.5 mGEOtopNotes on numerics of GEOtopR. Rigon and M. Dall’AmicoWednesday, April 24, 13
  59. 59. Beyond and side by side withnumerics - IIRiccardo RigonDance,HenryMatisse,HotelBironearly1909Wednesday, April 24, 13
  60. 60. When you arrive at Naples, youare not at the South of Italy.When you are at ReggioCalabria, you are at the South!Giuseppe FormettaWednesday, April 24, 13
  61. 61. 58•Produrre un sistema di supporto alle decisioni (DSS)•Produrre un sistema “democratico”, facilmente mantenibile, che favoriscala cooperazione tra ricercatori•Produrre Ricerca Riproducibile (RRS)•Adottare un sistema informatico appropriato a trattare i dati di contornodel solutore numericoAver individuato le giuste equazioni e i corretti metodinumerici non bastaIntroductionR. RigonWednesday, April 24, 13
  62. 62. 59MODELSIS MODELING SCIENCE ?R. RigonWednesday, April 24, 13
  63. 63. 60To sum upDataParametersEquationsMass,momentum andenergyconservation.ChemicaltransformationsForcings andobervablesEquation’sconstant. In time!In space they areheteorgeneousHydrological models are the interplay ofModelsR. RigonWednesday, April 24, 13
  64. 64. 61To sum upNumerics,boundary andinitial conditionsDataAssimilation.Data Models.Tools forAnalysis.Calibration,derivation fromproxiesDataParametersEquationsMass,momentum andenergyconservation.ChemicaltransformationsForcings andobervablesEquation’sconstant. In time!In space they areheteorgeneousModelsR. RigonWednesday, April 24, 13
  65. 65. 62Boundary and initial conditionsEquations are not enoughR. RigonWednesday, April 24, 13
  66. 66. 63Meteo ForcingsEquations are not enoughR. RigonWednesday, April 24, 13
  67. 67. Hourly:- Precipitation (quantity and type, spatially distributed)- Relative humidity (spatially distributed)- Wind Speed and direction (spatially distributed)- Solar Radiation (spatially distributed)64Required Input DataEquations are not enoughR. RigonWednesday, April 24, 13
  68. 68. - Soil moisture (profile, in terms of matric potential, spatiallydistributed)- Soil temperature (profile, spatially distributed)- Surface water (if present)- Snow cover (if present)65Other Input DataEquations are not enoughR. RigonWednesday, April 24, 13
  69. 69. 66Equations are not enoughFields of ParametersR. RigonWednesday, April 24, 13
  70. 70. Data baseCalibrazioneEVALUATION OFSTRATEGIES THROUGHMODELSSTRATEGIES FORPOLICY MAKERSDATAINTERPRETATION67DDSModelling is not just forModellingR. RigonWednesday, April 24, 13
  71. 71. 68I - Once a model, design and implemented as a monolithicsoftware entity, has been deployed, its evolution is totally inthe hands of the original developers. While this is a goodthing for intellectual property rights and in a commercialenvironment, this is absolutely a bad thing for science andthe way it is supposed to progress.RobbedfromaCCApresentationA critique of old modelling styleR. RigonWednesday, April 24, 13
  72. 72. 69II - Independent revisions and third-partycontributions are nearly impossible and especially whenthe code is not available.Models falsification (in Popper sense) is usually impossible byother scientists than the original authors.III- Thus, model inter-comparison projects give usuallyunsatisfying results. Once complex models do notreproduce data it is usually very difficult todetermine which process or parameterization wasincorrectly implemented.A critique of old modelling styleR. RigonWednesday, April 24, 13
  73. 73. 70MODELLING, FOR WHO ?Which end user do you have in mind ?SCIENTIST ARE NOT THE ONLY MODELS USERSR. RigonWednesday, April 24, 13
  74. 74. 71Users/ActorsFour types of user have been defined:• Prime users: take or prepare decisions at a political level• Technical users: prepare projects or maps for the primary users• Other end-users: national agencies, representative groups, etc.Theymay take or prepare decisions at national or regional level, or representstakeholder groups.• Model and application developers/modellers: buildmodels and targeted applicationsSCIENTIST ARE NOT THE ONLY MODELS USERSR. RigonWednesday, April 24, 13
  75. 75. 72Users/ActorsThese groups have been further detailed according to their roles:• Coders: implement models, applications and tools.• Linkers: link existing models and applications.• Runners: execute existing models, but they create and definescenarios.• Players: play simulations and experiments comparing scenarios andmaking analyses.• Viewers: view the players’ results, have a low level of interaction withthe framework.• Providers: provide inputs and data to all other user roles.SCIENTIST ARE NOT THE ONLY MODELS USERSR. RigonWednesday, April 24, 13
  76. 76. 73Users/ActorsRolesUsersHardCodersSoftCodersLinkers Runners Player Viewers ProvidersPrimeOther EndUsersTechnicalResearchersSCIENTIST ARE NOT THE ONLY MODELS USERSR. RigonWednesday, April 24, 13
  77. 77. 74Object-oriented software development. O-Oprogramming is nothing new, but it has proven to be a successfulkey to the design and implementation of modelling frameworks.Models and data can be seen as objects and therefore they canexploit properties such as encapsulation, polymorphism, dataabstraction and inheritance.Component-oriented software development. Objects(models and data) should be packaged in components, exposing forre-use only their most important functions. Libraries ofcomponents can then be re-used and efficiently integrated acrossmodelling frameworks.Yet, a certain degree of dependency of themodel component from the framework can actually hinder reuse.NEW (well relatively) MODELING PARADIGMSModifiedfromRizzolietal.,2005MODELLING BY COMPONENTSR. RigonWednesday, April 24, 13
  78. 78. 75MODELLING BY COMPONENTSR. RigonWednesday, April 24, 13
  79. 79. 76Discrete units of software which are re-usableeven outside the framework, both for model componentsand for tools components.Seamless and transparent access to data, whichare made independent of the database layer.A number of tools (simulation, calibration, etc.) that themodeller will be free to use (including a visual modellingenvironment).A model repository to store your model (andsimulations) and to share it with others.BENEFITSMODELLING BY COMPONENTSR. RigonWednesday, April 24, 13
  80. 80. 77Tools for studying feedbacks among different processes.BENEFITS FOR SCIENTISTSEncapsulation of single processes or submodelsMUCH MORE in the field of possibilitiesNew educational tools and a “storage” of hydrologicalknowledge using appropriate onthologiesMODELLING BY COMPONENTSR. RigonWednesday, April 24, 13
  81. 81. 78T H E R E E X I S T S U C H M O D E L I N GINFRASTRUCTURE ?Economic modelling frameworks^. GAMS (generalalgebraic modelling system, http://www.gams.com) and GTAP(global trade analysis program, http://www.gtap.agecon.purdue.edu ) are some of the most usedmodelling systems in the agro-economic domain.They can alsoaccount for social variables, such as unemployment.^from Rizzoli et al., (Modeling Framework (SeamFrame)Requirements 2005MODELLING BY COMPONENTSR. RigonWednesday, April 24, 13
  82. 82. 79T H E R E E X I S T S U C H M O D E L I N GINFRASTRUCTURE ?Environmental modelling frameworks. If we limit to theagricultural domain, the list is quite limited.There is no ‘real’framework according to the definition, but APSIM, STICSand CropSyst provide some of the functionalities. In this areaSEAMFRAME is an emerging technology.When we considerthe water management sector, we find many examples, suchas TIME (the invisible modelling environment), IMT, OpenMI,and OMS, and, to a certain respect, JUPITER-API.^ extended from Rizzoli et al., (Modeling Framework(SeamFrame) Requirements 2005MODELLING BY COMPONENTSR. RigonWednesday, April 24, 13
  83. 83. 80T H E R E E X I S T S U C H M O D E L I N GINFRASTRUCTURE ?Other modelling software environments of notableinterest are SME, MMS, ICMS, Tarsier, Modcom,Simile, but they are integrated modelling environments, notframeworks.This means that they can be used to performassessments, analyses, decision support, but they do not provideprogramming structures such as classes, components, objects,design patterns to be used to create end-user applications.^from Rizzoli et al., Modeling Framework (SeamFrame)Requirements, 2005MODELLING BY COMPONENTSR. RigonWednesday, April 24, 13
  84. 84. 81T H E R E E X I S T S U C H M O D E L I N GINFRASTRUCTURE ?Other modelling software environments of notableinterest are SME, MMS, ICMS, Tarsier, Modcom,Simile, but they are integrated modelling environments, notframeworks.This means that they can be used to performassessments, analyses, decision support, but they do not provideprogramming structures such as classes, components, objects,design patterns to be used to create end-user applications.^from Rizzoli et al., Modeling Framework (SeamFrame)Requirements, 2005MODELLING BY COMPONENTSR. RigonWednesday, April 24, 13
  85. 85. 82T H E R E E X I S T S U C H M O D E L I N GINFRASTRUCTURE ?Atmospheric Sciences: Earth Sciences Modeling Framework(ESMF) (including Earth System Curator)High Performance Computing: Common ComponentArchitecture (CCA)MODELLING BY COMPONENTSR. RigonWednesday, April 24, 13
  86. 86. 83DEPLOYEMENTPREREQUISITESALLOWS WRAPPING OF EXISTING CODES BUTPROMOTES BETTER PROGRAMMING STRATEGIESBUILT BY OPEN SOURCE TOOLSDATA BASE PROVIDEDOGC COMPLIANTCUAHSI SPECIFICATIONS AWAREDEPLOYABLE THROUGH THE WEBCAN BE ENDOWED WITH ONTOLOGIESR. RigonWednesday, April 24, 13
  87. 87. 84The complete frameworkPostGISPostgresWebservicesWMSWFS-TWPSWebservicesWMSWFS-TWPSOMS3JgrasstoolsJGrassuDigEclipse RCPH2 spatialUIBuilderGRASSGIS engineThe HortonMachineModelsBeeGISDEPLOYEMENTR. Rigon with HydrologisWednesday, April 24, 13
  88. 88. 85JavaJGrassuDigEclipse RCPSOLIDITY: The framework bases on the solid fundaments of the Eclipse RCPframework first created by IBM.CONNECTIVITY and USERFRIENDLYNESS:The GIS framework is based on the uDigGIS framework, specialized in accessibility and remote connectionsANALYSIS: The JGrass extentions define a layer of powerful GIS analysis tools and astraight connection to the GRASS GISMOBILITY:The BeeGIS extentions supply tools for digital field surveyingBeeGISDEPLOYEMENTR. Rigon with HydrologisWednesday, April 24, 13
  89. 89. 86Connectivity and web standardsDatabase:PostGIS-PostgresH2 spatialWeb servicesWMSWFS-Tsoon WPSDATABASE: The GIS framework is ready to connectto external relational databases as postgres, mysql ororacle. To spatial data servers like postgis, Oraclespatial and Arcsde. It also comes with an internalspatial database based on H2 (no indexing yet)‫‏‬‫‏‬.It would be fairly easy to create connections toRESTful services to acquire data.WEB SERVICES AND STANDARD WEB PROTOCOLS:The framework supports OGC web standardslike the web mapping service (WMS), the webfeature service, also in transactional format (WFS-T). An efforth for the web processing service isongoing.DEPLOYEMENTR. Rigon with HydrologisWednesday, April 24, 13
  90. 90. 87The analysis engineOpenMIGRASSTHE CONSOLE ENGINE: the console enginesupplies a framework for modeling developmentand scripting environment for fastmethodology testing.The engine contains alreadymasses of modules called Horton Machine forvarious terrain analyses as well as a stabilitymodel and hydrologic models.Also the engine gives access to the GRASSanalysis modules.THE STANDALONE MODE:The need for usageof the modelling environment on supercomputerdefined a heavily decoupled design for theconsole engine. The framework defines a strictinterface between GUI and analysis engine, whichmakes it easy to exploit the console engine instandalone mode on server-side.The HortonMachineModelsDEPLOYEMENTR. Rigon with HydrologisWednesday, April 24, 13
  91. 91. 88The relationship to OMS3OMS3THE OMS3 ENGINE: the console engine exposes acompiler for an OMS3 based modeling language.Thisgives a way to write scripts to execute openmi chainedmodels.THE OGC STANDARDS EXTENTION:The need for bigvector and raster data forced the team to extend theOMS3 standard interfaces with two GIS OGC standards:the OGC feature modelthe OGC grid coverage service (in prototype mode)‫‏‬OGC IN JGRASS: the OGC feature and grid coverage models are served by thegeotools libraries.The coverage model is based on the Java Advanced Imaginglibrary and supports tilecaching for processing of large dataset. Coverage data arepassed to native languages as C, C++ and Fortran through the easy adoptableJNA libraries.The HortonMachineModelsDEPLOYEMENTR. Rigon with HydrologisWednesday, April 24, 13
  92. 92. 89Not just an ideabut a realityThe case of JGrass-NewAGEThe State Of Art of the ProjectR. Rigon with Hydrologis and G. FormettaWednesday, April 24, 13
  93. 93. 90Formetta et al., CAHMDA IV Lhasa 2010 - July 21-235Modelling with componentsGIS Integration Multi-platformMulti-languageOpen-source Reproducible research systemNewAge Goals:Motivation Outline Hydrological Components Modelling Framework ConclusionsTrento 19 April 2013G. Formetta,The State Of Art of the ProjectR. Rigon with Hydrologis and G. FormettaWednesday, April 24, 13
  94. 94. 91The RRS conceptSince research and technical work rely on daily use of computer programs•Models configurations•Models setup•Models input data•Models output•Results interpretationShould be sharable in the easiest wayThe State Of Art of the ProjectR. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13
  95. 95. 92Formetta et al., CAHMDA IV Lhasa 2010 - July 21-2310Model settingHillslopeFeaturesBasin splittedin hillslopesOutline Calibration Issues Data AssimilationMotivation Hydrological ComponentTrento 17 June 2011G. Formetta, Trento 24 June 2011Outline ConclusionsInformatic StructureHydrological ComponentsLeipzig 05 July 2012G. Formetta,Motivation Outline Hydrological Components Modelling Framework ConclusionsTrento 19 April 2013G. Formetta,The State Of Art of the ProjectHydrologis, R. Rigon and G. FormettaWednesday, April 24, 13
  96. 96. 93Formetta et al., CAHMDA IV Lhasa 2010 - July 21-231Model settingNetwork splittedin linksLinksFeaturesOutline Calibration Issues Data AssimilatMotivation Hydrological ComponentTrento 17 June 2011G. Formetta, Trento 24 June 2011Outline Calibration IssuInformatic Structure Hydrological ComponentsLeipzig 05 July 2012G. Formetta,Motivation Outline Hydrological Components Modelling Framework ConclusionTrento 19 April 2013G. Formetta,The State Of Art of the ProjectHydrologis, R. Rigon and G. FormettaWednesday, April 24, 13
  97. 97. 94Formetta et al., CAHMDA IV Lhasa 2010 - July 21-2316Outline Calibration Issues Data AssimilationMotivation Hydrological ComponentTrento 17 June 2011G. Formetta, Trento 24 June 2011Interpolation ProblemVerification ProcedureOutline Calibration IssuesInformatic Structure Hydrological Components1) Start from a complete datasetOutline ConclusionsInformatic StructureHydrological ComponentsLeipzig 05 July 2012G. Formetta,Motivation Outline Hydrological Components Modelling Framework ConclusionsTrento 19 April 2013G. Formetta,The State Of Art of the ProjectR. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13
  98. 98. 95Formetta et al., CAHMDA IV Lhasa 2010 - July 21-2321Precipitation Interpolation: KrigingsMotivation Outline Hydrological Components Modelling Framework ConclusionsTrento 19 April 2013G. Formetta,The State Of Art of the ProjectR. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13
  99. 99. 96Formetta et al., CAHMDA IV Lhasa 2010 - July 21-2328Shortwave Energy Model: raster mode application on Piave riverSimulation time step: hourlySimulation Period: 01/10/201-02/10/2010Motivation Outline Hydrological Components Modelling Framework ConclusionsTrento 19 April 2013G. Formetta,The State Of Art of the ProjectR. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13
  100. 100. 97Formetta et al., CAHMDA IV Lhasa 2010 - July 21-2329NewAge-OMS3 automatic calibration algorithmsGeneric Parameter setOptimal Parameter setUncertainty:•  catchment heterogeneity•  model limitations•  measurement techniquesMotivation Outline Hydrological Components Modelling Framework ConclusionsTrento 19 April 2013G. Formetta,The State Of Art of the ProjectR. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13
  101. 101. 98Formetta et al., CAHMDA IV Lhasa 2010 - July 21-2334Outline Calibration Issues Data AssimilationMotivation Hydrological ComponentTrento 17 June 2011G. Formetta, Trento 24 June 2011Outline Calibration IssuesInformatic Structure Hydrological ComponentsOutline ConclusionsInformatic StructureHydrological ComponentsLeipzig 05 July 2012G. Formetta,Basin Delineation ConclusionsFormetta G., ARS-USDA-Fort Collins (CO)Motivation Hydrological ComponentsFormetta G., David O. and Rigon R.Little Washita river basin: Rainfall-Runoff modelling solutionMotivation Outline Hydrological Components Modelling Framework ConclusionsTrento 19 April 2013G. Formetta,The State Of Art of the ProjectR. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13
  102. 102. 99Formetta et al., CAHMDA IV Lhasa 2010 - July 21-2339Something more than a classical modelOutline Calibration Issues Data AssimilationMotivation Hydrological ComponentRome 09 March 2011Trento 17 June 2011G. Formetta, Trento 24 June 2011Different possibility to run OMS3 componentsuDig 1.3.1 Spatial ToolboxTrento 24 June 2011Outline Calibration IssuesInformatic Structure Hydrological ComponentsOutline ConclusionsInformatic StructureHydrological ComponentsLeipzig 05 July 2012G. Formetta,Motivation Outline Hydrological Components Modelling Framework ConclusionsTrento 19 April 2013G. Formetta,The State Of Art of the ProjectHydrologis, R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13
  103. 103. 100Formetta et al., CAHMDA IV Lhasa 2010 - July 21-2340Something more than a classical modelOutline Calibration Issues Data AssimilationMotivation Hydrological ComponentRome 09 March 2011Trento 17 June 2011uDig 1.3.1 Spatial ToolboxOMS3 ConsoleDifferent possibility to run OMS3 componentsOutline Calibration IssuesInformatic Structure Hydrological ComponentsOutline ConclusionsInformatic StructureHydrological ComponentsLeipzig 05 July 2012G. Formetta,Motivation Outline Hydrological Components Modelling Framework ConclusionsTrento 19 April 2013G. Formetta,The State Of Art of the ProjectHydrologis, R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13
  104. 104. 101Formetta et al., CAHMDA IV Lhasa 2010 - July 21-2341Something more than a classical modelOutline Calibration Issues Data AssimilationMotivation Hydrological ComponentRome 09 March 2011Trento 17 June 2011G. Formetta, Trento 24 June 2011OMS3 ConsoleCommand LineuDig 1.3.1 Spatial ToolboxOutline Calibration IssuesInformatic Structure Hydrological ComponentsOutline ConclusionsInformatic StructureHydrological ComponentsLeipzig 05 July 2012G. Formetta,Different possibility to run OMS3 componentsMotivation Outline Hydrological Components Modelling Framework ConclusionsTrento 19 April 2013G. Formetta,The State Of Art of the ProjectHydrologis, R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13
  105. 105. 102Formetta et al., CAHMDA IV Lhasa 2010 - July 21-2342Something more than a classical modelOutline Calibration Issues Data AssimilationMotivation Hydrological ComponentRome 09 March 2011G. Formetta,What is a .sim file?Outline Calibration IssuesInformatic Structure Hydrological ComponentsOutline ConclusionsInformatic StructureHydrological ComponentsLeipzig 05 July 2012G. Formetta,Motivation Outline Hydrological Components Modelling Framework ConclusionsTrento 19 April 2013G. Formetta,The State Of Art of the ProjectHydrologis, R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13
  106. 106. 103Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23The file structure is differentrespect to a common .sim file:- Model: here the model has tobe calibrated- PSO Parameters: here haveto be assigned- Model Parameters to optimize:here have to be assigned- Objective Function, Model outputand measurements: here have tobe assignedParticle Swarm calibration .sim fileOutline ConclusioInformatic StructureHydrological ComponentsLeipzig 05 July 2012G. Formetta,Motivation Outline Hydrological Components Modelling Framework ConclusTrento 19 April 2013G. Formetta,The State Of Art of the ProjectR. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13
  107. 107. 104EPILOGUEOUR AIM IS NOT TO MODEL EVERYTHING*ORDO A MODEL OF EVERYTHING BUT GIVE AS P A C E W E R E D I F F E R E N T , E V E NCONTRADICTORY, IDEAS,AND DATA CAN BEEXPLOITED IN A WAY WHICH PROPELSCOLLABORATIVE EFFORTS BY SCIENTISTSAND USERS.*“Correctly interpreted, you know, pi contains the entire history of the human race.”-Dr. Irving Joshua Matrix, from M. Gardner,“The magic numbers of dr. Matrix”The Overall GoalR. Rigon, and the whole groupWednesday, April 24, 13
  108. 108. 105Direct Contributors:Andrea Antonello uDig and jgrasstools core developer and architectGiacomo Bertoldi GEOtop developer (energy budgets, vegetation)Emanuele Cordano GEOtop developer (Richards equation, I/O)Matteo Dall’Amico GEOtop developer (permafrost, GEOtop-mono)Stefano Endrizzi GEOtop developer (energy budgets, snow, permafrost)Giuseppe Formetta JGrass-NewAGE developersSilvia Franceschi Jgrasstools models developer and architectRiccardo Rigon All the merits go to the othersErica Ghesla, Andrea Cozzini, Silvano Pisoni and others contributed to original version of theHorton MachineAcknowledgementsR. RigonWednesday, April 24, 13
  109. 109. 106G.Ulrici-2000?Thank youR. RigonWednesday, April 24, 13

×