+ All Categories
Home > Education > Beyond and side by side with numerics

Beyond and side by side with numerics

Date post: 18-May-2015
Category:
Upload: cafe-geoframe
View: 231 times
Download: 4 times
Share this document with a friend
Description:
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.
Popular Tags:
109
Beyond and side by side with numerics -I Riccardo Rigon Dance, Henry Matisse, Hotel Biron early 1909 Wednesday, April 24, 13
Transcript

Beyond and side by side with numerics -I

Riccardo Rigon

Dan

ce, H

enry

Mat

isse

, Hot

el B

iron

ear

ly 1

909

Wednesday, April 24, 13

They started from wrong

assumptions, and applying a

perfect logic, they arrived

rigorously to wrong results.

My father in law

Wednesday, April 24, 13

3

I am here to tell you about

What are the central topics of the work of the modellers

•Find the right equations

Introduzione

R. Rigon

•Find the right numerical methods

Wednesday, April 24, 13

4

Are Richards’ equation right ?

Well, they represents mass conservation: and this is a basic principle

However

What happens when soil turns to saturation ?

What happens when soil freezes ?

What happens when warms, goofers or roots escavate the soil ?

Richards ++

R. Rigon

Wednesday, April 24, 13

5

What I mean with Richards ++

First, I would say, it means that it would be better to call it, for

instance: Richards-Mualem-vanGenuchten equation, since it is:

Se = [1 + (��⇥)m)]�n

Se :=�w � �r

⇥s � �r

C(⇥)⇤⇥

⇤t= ⇥ ·

�K(�w) �⇥ (z + ⇥)

K(�w) = Ks

⇧Se

⇤�1� (1� Se)1/m

⇥m⌅2

C(⇥) :=⇤�w()⇤⇥

Richards ++

R. Rigon and E. Cordano

Wednesday, April 24, 13

5

What I mean with Richards ++

First, I would say, it means that it would be better to call it, for

instance: Richards-Mualem-vanGenuchten equation, since it is:

Se = [1 + (��⇥)m)]�n

Se :=�w � �r

⇥s � �r

C(⇥)⇤⇥

⇤t= ⇥ ·

�K(�w) �⇥ (z + ⇥)

K(�w) = Ks

⇧Se

⇤�1� (1� Se)1/m

⇥m⌅2

Water balance

C(⇥) :=⇤�w()⇤⇥

Richards ++

R. Rigon and E. Cordano

Wednesday, April 24, 13

5

What I mean with Richards ++

First, I would say, it means that it would be better to call it, for

instance: Richards-Mualem-vanGenuchten equation, since it is:

Se = [1 + (��⇥)m)]�n

Se :=�w � �r

⇥s � �r

C(⇥)⇤⇥

⇤t= ⇥ ·

�K(�w) �⇥ (z + ⇥)

K(�w) = Ks

⇧Se

⇤�1� (1� Se)1/m

⇥m⌅2

Water balance

ParametricMualem

C(⇥) :=⇤�w()⇤⇥

Richards ++

R. Rigon and E. Cordano

Wednesday, April 24, 13

5

What I mean with Richards ++

First, I would say, it means that it would be better to call it, for

instance: Richards-Mualem-vanGenuchten equation, since it is:

Se = [1 + (��⇥)m)]�n

Se :=�w � �r

⇥s � �r

C(⇥)⇤⇥

⇤t= ⇥ ·

�K(�w) �⇥ (z + ⇥)

K(�w) = Ks

⇧Se

⇤�1� (1� Se)1/m

⇥m⌅2

Water balance

ParametricMualem

Parametricvan Genuchten

C(⇥) :=⇤�w()⇤⇥

Richards ++

R. Rigon and E. Cordano

Wednesday, April 24, 13

6

What happens when

In terms of soil water content, it cannot become larger than porosity (if the matrix is considered rigid).

At the transition with saturation

R. Rigon and E. Cordano

Wednesday, April 24, 13

7

What I mean with Richards ++

Extending Richards to treat the transition saturated to unsaturated zone. Which means:

At the transition with saturation

R. Rigon and E. Cordano

Wednesday, April 24, 13

8

So we switch to a generalisedgroundwater equations

which has been obtained by modifying the SWRC

At the transition with saturation

R. Rigon and E. Cordano

Wednesday, April 24, 13

9

What about soil freezing ?

In terms of soil water content, it cannot become larger than porosity (if the matrix is considered rigid).

Soil Freezing

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

10

dS(U, V, M) = 0

first principle

potential energy

kineticenergy

internalenergy

energy fluxes at the boundaries

second principle

the equilibrium relation becomes:

(But they are not 2 equations. The second is just a restriction on the first ). Assuming:

K( ) = 0 ; P ( ) = 0 ; �( ) = 0

Which equations ?Soil Freezing

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

11

Uc( ) := 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

⇥t

Internal Energy

entropy areavolume mass

Independent variables

To find how the equations are modified we go to the basics

Soil Freezing

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

12

Expression Symbol Name of the dependent variable⇤SUc T temperature

- ⇤V Uc p pressure⇤AUc � surface energy⇤MUc µ chemical potential

To find how the equations are modified we go to the basics

So the equation for each phase is:

Soil Freezing

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

13

dS( ) =�

1Tw

� 1Ti

⇥dUw( ) +

�pw

Tw� pi

Ti

⇥dVw( )�

�µw( )Tw

� µi( )Ti

⇥dMw = 0

�⇤

Ti = Tw

pi = pw

µi = µw

the equilibrium relation becomes:

Flat interfaces at equilibrium

*

* The derivation is not so straightforward and implies the use of Lagrange multipliers. See Muller and Weiss,2005

Water Freezing

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

14

first principle

potential energy

kineticenergy

internalenergy

energy fluxes at the boundaries

second principle

but:

(But they are not 2 equations. The second is just a restriction on the first ). Assume:

Let’s condsider a disequilibrium process

Soil Freezing equations

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

15

Dirichlet Boundary Conditions

Dirichlet Boundary Conditions

The Stefan problem

The Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

16

Ice (thermal conductivity,

thermal capacity)

Water (thermal conductivity,

thermal capacity)

The Stefan problem

The Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

17

Diffusion of heat through water

The Stefan problem

Diffusion of heat through ice

The Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

18

Different condition at the interface

The Stefan problem

The Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

19

�⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⇤

⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⌅⇥

v1 = v2 = Tref (t > 0, z = Z(t))

v2 ⇥ Ti (t > 0, z ⇥⇤)

v1 = Ts (t > 0, z = 0)

⇥1�v1�z � ⇥2

�v2�z = Lf ⇤w �s

dZ(t)dt (t > 0, z = Z(t))

�v1�t = k1

�2v1�z2 (t > 0, z < Z(t))

�v2�t = k2

�2v2�z2 (t > 0, z > Z(t))

v1 = v2 = Ti (t = 0, z)

Freezing case (1D discretization)

Equations of the Stefan Problem

The Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

20

• Moving boundary condition between the two phases, where heat is liberated or absorbed

• Thermal properties of the two phases may be different

The Stefan Problem

The Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

21

�⌅⌅⇤

⌅⌅⇥

v1(t, z) = Ts + Tref�Ts

erf � · erf z2⇥

k1 tif z ⇤ Z(t)

v2(t, z) = Ti � Ti�Tref

erfc“

�q

k1k2

” · erfc z2⇥

k2 tif z > Z(t)

�⌅⌅⇤

⌅⌅⇥

v1(t, z) = Ti � Ti�Tref

erfc“

�q

k2k1

” · erfc z2⇥

k1 tif z > Z(t)

v2(t, z) = Ts + Tref�Ts

erf � · erf z2⇥

k2 tif z ⇤ Z(t)

where ζ is the solution of:

Freezing case:

exp(��2)� · erf �

� ⇤T1⇤

k2 (Ti � Tref )

⇤T2⇤

k1 (Tref � Ts) � · erfc��⇧

k2k1

⇥ · exp⇤�k2

k1�2

⌅=

Lf ⇧w ⇥s⇤

CT2 (Tref � Ts)

where ζ is the solution of:

Thawing case:

exp(��2)� · erf �

� ⇤T2⇤

k1 (Ti � Tref )

⇤T1⇤

k2 (Tref � Ts) � · erfc��⇧

k1k2

⇥ · exp⇤�k1

k2�2

⌅=

Lf ⇧w ⇥s⇤

CT1 (Tref � Ts)

The Stefan Problem: analitic solutions

The Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

22

Well, the real case is a little more complicate

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

23

Water is

•often in unsaturated conditions

•in pores

•it is known that it does not freeze until very negative temperatures are obtained

Beyond the Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

24

Unsaturated conditions

•Means that capillary forces acts, i.e. we have to account for the tension forces that accumulate in curves surfaces

Beyond the Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

25

pw = pa � �wa⇤Awa(r)⇤Vw(r)

= pa � �wa⇤Awa/⇤r

⇤Vw/⇤r= pa � �wa

2r

:= pa � pwa(r)

Young-Laplace equation

pa

pw

the equilibrium condition:

becomes:

What does it means unsaturated conditions

Beyond the Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

26

⇤ dp

dT=

sw( )� si( )vw( )� vi( )

=hw( )� hi( )

T [vw( )� vi( )]⇥ Lf ( )

T [vw( )� vi( )]

where Lf = 333000 J/Kg is the latent heat of fusion

Clausius-Clapeyron equation

Beyond the Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

27

A paradox ?

Water inside a capillary is at a lower pressure than atmosphere.

Therefore it should freeze before (lower the pressure, higher the freezing

temperature.

Beyond the Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

28

A paradox ?

Instead what happens is exactly the contrary, because for freezing a nucleus of condensation has to occur

r

with r << r

Beyond the Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

29

So, actually

The situation at the freezing point is the opposite, and represented by the

blue arrowFreezing point depression

Beyond the Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

30

Because, the smaller the pores,

the larger the freezing point depression

larger pores freezes before than

smaller pores

Beyond the Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

31

Because

by means of the Clausius-Clapeyron equation

there is a one-to-one relations between the size of the pores and the temperature

depression, and because there is also a one-to-one relationship between the

size of the pores and the pressure

there is a one-one relation among T and

Beyond the Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

32

Unsaturatedunfrozen

UnsaturatedFrozen

Freezingstarts

Freezingprocedes

Beyond the Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

33

pw0 = pa � �wa⇥Awa(r0)

⇥Vw= pa � pwa(r0) pi = pa � �ia

⇥Aia(r0)⇥Vw

:= pa � pia(r0)

pw1 = pa � �ia⇥Aiar(0)

⇥Vw� �iw

⇥Aiw(r1)⇥Vw

Two interfaces (air-ice and water-ice) should be considered!!!

Curved interfaces with three phases

Beyond the Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

34

Now

we have enough information to write the right equations

Perhaps

Beyond the Stefan problem

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

35

A further assuption

To make it manageable, we do a further assuption. Mainly the freezing=drying

assuption.

Considering the assumption “freezing=drying” (Miller, 1963) the ice “behaves

like air” and does not add furhter pressure terms

Freezing = Drying

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

36

pw1 = pw0 + �pfreez

Freezing = Drying

Freezing = Drying

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

37

Unfrozen water content

soil water retention curve

thermodynamicequilibrium (Clausius Clapeyron)

+

⇥w =pw

�w gpressure head:

�w(T ) = �w [⇥w(T )]

How this reflects on pressure head

Freezing = Drying

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

38

�w =�s

Aw |⇥|� + 1

⇥w = ⇥r + (⇥s � ⇥r) · {1 + [�� (⇤)]n}�m

�maxw = �s ·

�Lf (T � Tm)

g T ⇥sat

⇥-1/bClapp and Hornberger (1978)

Luo et al. (2009), Niu and Yang (2006), Zhang et al. (2007)

Gardner (1958) Shoop and Bigl (1997)

Van Genuchten (1980) Hansson et al (2004)

How this reflects on pressure head

Freezing = Drying

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

39

Unsaturatedunfrozen

UnsaturatedFrozen

Freezingstarts

Freezingprocedes

Soil water retention curvesFreezing = Drying

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

40

−0.05 −0.04 −0.03 −0.02 −0.01 0.00

0.1

0.2

0.3

0.4

Unfrozen water content

temperature [C]

Thet

a_u

[−]

psi_m −5000

psi_m −1000

psi_m −100

psi_m 0

ice

air

water

...

T � := T0 +g T0

Lf�w0

T* at various saturation contents

� = ⇥r + (⇥s � ⇥r) · {1 + [�� · ⇤w0]n}�m

ice content: �i =⇥w

⇥i

��� �w

⇥w = ⇥r + (⇥s � ⇥r) ·⇤

1 +���⇤w0 � �

Lf

g T0(T � T ⇥) · H(T � T ⇥)

⇥n⌅�m

liquid water content:

Total water content:

depressed melting point

Soil water retention curvesFreezing = Drying

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

41

Soil water retention curvesFreezing = Drying

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

42

Soil water retention curvesFreezing = Drying

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

43

-3 -2 -1 0 1

0.0

0.2

0.4

0.6

0.8

1.0

n=1.5

temperature [C]

the

ta_

w/t

he

ta_

s [

-]

psi_w0=0 psi_w0=-1000

alpha=0.001 [1/mm]

alpha=0.01 [1/mm]

alpha=0.1 [1/mm]

alpha=0.4 [1/mm]

-10000 -8000 -6000 -4000 -2000 0

0.0

0.2

0.4

0.6

0.8

1.0

n=1.5

psi_w0 [mm]

the

ta_

w/t

he

ta_

s [

-]

T=2 T=-2

alpha=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-4

T = �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-8

25

θw/θs at ψw0=−1000 [mm]

Playing with Van GenucthenFreezing = Drying - Numbers

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

44

⇤t

��fl

w (⇥w1)⇥� �⇤ •

⇤KH

�⇤ ⇥w1 + KH�⇤ zf

⌅+ Sw = 0

Liquid water may derive fromice melting: ∆θph

water flux: ∆θfl

Volume conservation: ⇤⌃⇧

⌃⌅

0 ⇥ �r ⇥ ⇥ ⇥ �s ⇥ 1

�r �⌥�w0 + �i0 +

�1� �i

�w

⇥��ph

i

�⇥ ��fl

w ⇥ �s �⌥�w0 + �i0 +

�1� �i

�w

⇥��ph

i

Mass conservation (Richards, 1931) equation:

Richards’ equation

Equation of freezing

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

45

U = Cg(1� �s) T + ⇥wcw�w T + ⇥ici�i T + ⇥wLf�w

�U

�t+ ⌥⇥ • (⌥G + ⌥J) + Sen = 0

⌃G = ��T (⇥w0, T ) · ⌃⇤T

�J = �w · �Jw(⇥w0, T ) · [Lf + cw T ]

0 assuming freezing=drying

U = hgMg + hwMw + hiMi � (pwVw + piVi) + µwMphw + µiM

phi

no expansion: ρw=ρi

assuming:0 no flux during phase change

Eventually:

0 assuming equilibrium thermodynamics: µw=µi and Mw

ph = -Miph

conduction

advection

Energy Equation

Equation of freezing

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

46

dU

dt= CT

dT

dt+ ⇥w

�(cw � ci) · T + Lf

⇥⇤�w

⇤t

⇤�w [⇥w1(T )]⇤t

=⇤�w

⇤⇥w1· ⇤⇥w1

⇤T· ⇤T

⇤t= CH(⇥w1) · ⇤⇥freez

⇤T· dT

dt

dU

dt=

⇤CT + �w

�Lf + (cw � ci) · T

⇥· CH(T ) · ⇤⇥freez(T )

⇤T

⌅· dT

dt

-3 -2 -1 0 1

020

40

60

80

100

140

alpha= 0.01 [1/mm] n= 1.5 theta_s= 0.4

Temp. [ C]

U [M

J/m

3]

psi_w0=0

psi_w0=-100

psi_w0=-1000

psi_w0=-10000

-3 -2 -1 0 1

alpha= 0.01 [1/mm] n= 1.5 C_g= 2300000 [J/m3 K]

Temp. [ C]

C_

a [

MJ/m

3 K

]

1e+01

1e+02

1e+03

psi_w0=0 psi_w0=-1000

theta_s= 0.02

theta_s= 0.4

theta_s= 0.8 {Capp

Appearent Heat CapacityEquation of freezing

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

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 = 0

1D representation:

Finally the “right” equations

Equation of freezing

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

48

GEOtop solver of freezing equations

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

49

The right numerical methods

Notes on numerics

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

50

• Finite difference discretization, semi-implicit Crank-Nicholson method;

• 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 numerics

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

51

if ||⌅�(⇥)m+1|| > ||⌅�(⇥)m|| ⌅ ⌅⇥m+1 ⇤ ⌅⇥m � ⌅⇥⇥ · �

reduction factor δ with 0 ≤ δ ≤ 1. If δ = 1 the scheme is the normal Newton-Raphson scheme

Globally convergent Newton Method

Notes on numerics

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

52

Limitations 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)

GEOtop

Notes on numerics of GEOtop

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

53

real 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.5

0.0

0.2

0.4

0.6

0.8

1.0

temperature [C]

Theta

_u [-]

modeled SFC for the comparison

real SFC

GEOtop

Notes on numerics of GEOtop

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

54

!5 !4 !3 !2 !1 0 1 2

54

32

10

Temp [ C]

so

il d

ep

th [

m]

phase change: simulated and analytical solution

alpha= 0.4 n= 2.5 theta_s= 1 theta_r= 0

sim 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

−1

01

2

0 15 30 45 60 75

An GEOtop

GEOtop Vs Analytical solution

alpha= 0.4 n= 2.5 theta_s= 1

0.02 m

0.12 m

0.22 m

0.32 m

0.42 m

0.52 m

0.62 m

0.72 m

Oscillations: interface Z=Z(T=0,t) cannot move in a continuum as the analytical solution. Therefore the interface can be either on the cell i or on the cell i+1 but not in between.

GEOtop

Notes on numerics of GEOtop

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

55

time (days)

T [C

]

!5

!4

!3

!2

!1

01

20 15 30 45 60 75

An GEOtop

GEOtop Vs Analytical solution

#layers= 100 , layer D= 200 mm, alpha= 0.4 n= 2.5 theta_s= 1

0.1 m

0.3 m

0.5 m

0.8 m

1.1 m

1.5 m

3 m

4.5 m

grid size=300 mm grid size=200 mm

time (days)

T [C

]

!5

!4

!3

!2

!1

01

2

0 15 30 45 60 75

An GEOtop

GEOtop Vs Analytical solution

#layers= 100 , layer D= 300 mm, alpha= 0.4 n= 2.5 theta_s= 1

0.15 m

0.3 m

0.5 m

0.8 m

1.1 m

1.5 m

3 m

4.5 m

GEOtop

Notes on numerics of GEOtop

R. Rigon and M. Dall’Amico

Wednesday, April 24, 13

Beyond and side by side with numerics - II

Riccardo Rigon

Dan

ce, H

enry

Mat

isse

, Hot

el B

iron

ear

ly 1

909

Wednesday, April 24, 13

When you arrive at Naples, you

are not at the South of Italy.

When you are at Reggio

Calabria, you are at the South!

Giuseppe Formetta

Wednesday, April 24, 13

58

•Produrre un sistema di supporto alle decisioni (DSS)

•Produrre un sistema “democratico”, facilmente mantenibile, che favorisca la cooperazione tra ricercatori

•Produrre Ricerca Riproducibile (RRS)

•Adottare un sistema informatico appropriato a trattare i dati di contorno del solutore numerico

Aver individuato le giuste equazioni e i corretti metodi numerici non basta

Introduction

R. RigonWednesday, April 24, 13

59

MODELS

IS MODELING SCIENCE ?

R. RigonWednesday, April 24, 13

60

To sum up

DataParametersEquations

Mass, momentum and

energy conservation.

Chemical transformations

Forcings and obervables

Equation’s constant. In time! In space they are heteorgeneous

Hydrological models are the interplay of

Models

R. RigonWednesday, April 24, 13

61

To sum up

Numerics, boundary and

initial conditions

Data Assimilation. Data Models.

Tools for Analysis.

Calibration, derivation from

proxies

DataParametersEquations

Mass, momentum and

energy conservation.

Chemical transformations

Forcings and obervables

Equation’s constant. In time! In space they are heteorgeneous

Models

R. RigonWednesday, April 24, 13

62

Boundary and initial conditions

Equations are not enough

R. RigonWednesday, April 24, 13

63

Meteo Forcings

Equations are not enough

R. RigonWednesday, April 24, 13

Hourly:

- Precipitation (quantity and type, spatially distributed)

- Relative humidity (spatially distributed)

- Wind Speed and direction (spatially distributed)

- Solar Radiation (spatially distributed)

64

Required Input Data

Equations are not enough

R. RigonWednesday, April 24, 13

- Soil moisture (profile, in terms of matric potential, spatially distributed)

- Soil temperature (profile, spatially distributed)

- Surface water (if present)

- Snow cover (if present)

65

Other Input Data

Equations are not enough

R. RigonWednesday, April 24, 13

66

Equations are not enough

Fields of Parameters

R. RigonWednesday, April 24, 13

Data baseCalibrazioneEVALUATION OF

STRATEGIES THROUGH MODELS

STRATEGIES FOR POLICY MAKERS

DATA INTERPRETATION

67

DDS

Modelling is not just for Modelling

R. RigonWednesday, April 24, 13

68

I - Once a model, design and implemented as a monolithic software entity, has been deployed, its evolution is totally in the hands of the original developers. While this is a good thing for intellectual property rights and in a commercial environment, this is absolutely a bad thing for science and the way it is supposed to progress.

Rob

bed

from

a C

CA

pre

sent

atio

n

A critique of old modelling style

R. RigonWednesday, April 24, 13

69

II - Independent revisions and third-party contributions are nearly impossible and especially when the code is not available. Models falsification (in Popper sense) is usually impossible by other scientists than the original authors.

III- Thus, model inter-comparison projects give usually unsatisfying results. Once complex models do not reproduce data it is usually very difficult to determine which process or parameterization was incorrectly implemented.

A critique of old modelling style

R. RigonWednesday, April 24, 13

70

MODELLING, FOR WHO ?Which end user do you have in mind ?

SCIENTIST ARE NOT THE ONLY MODELS USERS

R. RigonWednesday, April 24, 13

71

Users/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. They may take or prepare decisions at national or regional level, or represent stakeholder groups.

• Model and application developers/modellers: build models and targeted applications

SCIENTIST ARE NOT THE ONLY MODELS USERS

R. RigonWednesday, April 24, 13

72

Users/Actors

These 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 define scenarios.

• Players: play simulations and experiments comparing scenarios and making analyses.

• Viewers: view the players’ results, have a low level of interaction with the framework.

• Providers: provide inputs and data to all other user roles.

SCIENTIST ARE NOT THE ONLY MODELS USERS

R. RigonWednesday, April 24, 13

73

Users/Actors RolesUsers

Hard Coders

SoftCoders

Linkers Runners Player Viewers Providers

Prime

Other End Users

Technical

Researchers

SCIENTIST ARE NOT THE ONLY MODELS USERS

R. RigonWednesday, April 24, 13

74

Object-oriented software development . O-O programming is nothing new, but it has proven to be a successful key to the design and implementation of modelling frameworks. Models and data can be seen as objects and therefore they can exploit properties such as encapsulation, polymorphism, data abstraction and inheritance.

Component-oriented software development. Objects (models and data) should be packaged in components, exposing for re-use only their most important functions. Libraries of components can then be re-used and efficiently integrated across modelling frameworks. Yet, a certain degree of dependency of the model component from the framework can actually hinder reuse.

NEW (well relatively) MODELING PARADIGMS

Mod

ified

from

Riz

zoli

et a

l., 20

05

MODELLING BY COMPONENTS

R. RigonWednesday, April 24, 13

75

MODELLING BY COMPONENTS

R. RigonWednesday, April 24, 13

76

Discrete units of software which are re-usable even outside the framework, both for model components and for tools components.

Seamless and transparent access to data, which are made independent of the database layer.

A number of tools (simulation, calibration, etc.) that the modeller will be free to use (including a visual modelling environment).

A model repository to store your model (and simulations) and to share it with others.

BENEFITS

MODELLING BY COMPONENTS

R. RigonWednesday, April 24, 13

77

Tools for studying feedbacks among different processes.

BENEFITS FOR SCIENTISTS

Encapsulation of single processes or submodels

MUCH MORE in the field of possibilities

New educational tools and a “storage” of hydrological knowledge using appropriate onthologies

MODELLING BY COMPONENTS

R. RigonWednesday, April 24, 13

78

T H E R E E X I S T S U C H M O D E L I N G INFRASTRUCTURE ?

Economic modelling frameworks^. GAMS (general algebraic modelling system, http://www.gams.com) and GTAP (global trade analysis program, http://www.gtap.agecon.purdue.edu ) are some of the most used modelling systems in the agro-economic domain. They can also account for social variables, such as unemployment.

^from Rizzoli et al., (Modeling Framework (SeamFrame) Requirements 2005

MODELLING BY COMPONENTS

R. RigonWednesday, April 24, 13

79

T H E R E E X I S T S U C H M O D E L I N G INFRASTRUCTURE ?

Environmental modelling frameworks. If we limit to the agricultural domain, the list is quite limited. There is no ‘real’ framework according to the definition, but APSIM, STICS and CropSyst provide some of the functionalities. In this area SEAMFRAME is an emerging technology. When we consider the water management sector, we find many examples, such as 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 2005

MODELLING BY COMPONENTS

R. RigonWednesday, April 24, 13

80

T H E R E E X I S T S U C H M O D E L I N G INFRASTRUCTURE ?

Other modelling software environments of notable interest are SME, MMS, ICMS, Tarsier, Modcom, Simile, but they are integrated modelling environments, not frameworks. This means that they can be used to perform assessments, analyses, decision support, but they do not provide programming structures such as classes, components, objects, design patterns to be used to create end-user applications.

^from Rizzoli et al., Modeling Framework (SeamFrame) Requirements, 2005

MODELLING BY COMPONENTS

R. RigonWednesday, April 24, 13

81

T H E R E E X I S T S U C H M O D E L I N G INFRASTRUCTURE ?

Other modelling software environments of notable interest are SME, MMS, ICMS, Tarsier, Modcom, Simile, but they are integrated modelling environments, not frameworks. This means that they can be used to perform assessments, analyses, decision support, but they do not provide programming structures such as classes, components, objects, design patterns to be used to create end-user applications.

^from Rizzoli et al., Modeling Framework (SeamFrame) Requirements, 2005

MODELLING BY COMPONENTS

R. RigonWednesday, April 24, 13

82

T H E R E E X I S T S U C H M O D E L I N G INFRASTRUCTURE ?

Atmospheric Sciences: Earth Sciences Modeling Framework (ESMF) (including Earth System Curator)

High Performance Computing: Common Component Architecture (CCA)

MODELLING BY COMPONENTS

R. RigonWednesday, April 24, 13

83

DEPLOYEMENT

PREREQUISITES

ALLOWS WRAPPING OF EXISTING CODES BUT PROMOTES BETTER PROGRAMMING STRATEGIES

BUILT BY OPEN SOURCE TOOLS

DATA BASE PROVIDED

OGC COMPLIANT

CUAHSI SPECIFICATIONS AWARE

DEPLOYABLE THROUGH THE WEB

CAN BE ENDOWED WITH ONTOLOGIES

R. RigonWednesday, April 24, 13

84

The complete framework

PostGISPostgres

Webservices

WMSWFS-TWPS

Webservices

WMSWFS-TWPS

OMS3

Jgrasstools

JGrassuDig

Eclipse RCP

H2 spatial

UIBuilder

GRASS

GIS engine

The Horton Machine

Models

BeeGIS

DEPLOYEMENT

R. Rigon with HydrologisWednesday, April 24, 13

85

Java

JGrassuDig

Eclipse RCP

SOLIDITY: The framework bases on the solid fundaments of the Eclipse RCP framework first created by IBM.

CONNECTIVITY and USERFRIENDLYNESS: The GIS framework is based on the uDig GIS framework, specialized in accessibility and remote connections

ANALYSIS: The JGrass extentions define a layer of powerful GIS analysis tools and a straight connection to the GRASS GIS

MOBILITY: The BeeGIS extentions supply tools for digital field surveying

BeeGIS

DEPLOYEMENT

R. Rigon with HydrologisWednesday, April 24, 13

86

Connectivity and web standards

Database:PostGIS-PostgresH2 spatial

Web services

WMSWFS-T

soon WPS

DATABASE: The GIS framework is ready to connect to external relational databases as postgres, mysql or oracle. To spatial data servers like postgis, Oracle spatial and Arcsde. It also comes with an internal spatial database based on H2 (no indexing yet) .‏‏

It would be fairly easy to create connections to RESTful services to acquire data.

WEB SERVICES AND STANDARD WEB PROTOCOLS: The framework supports OGC web standards like the web mapping service (WMS), the web feature service, also in transactional format (WFS-T). An efforth for the web processing service is ongoing.

DEPLOYEMENT

R. Rigon with HydrologisWednesday, April 24, 13

87

The analysis engine

OpenMI

GRASS

THE CONSOLE ENGINE: the console engine supplies a framework for modeling development and scripting environment for fast methodology testing.The engine contains already masses of modules called Horton Machine for various terrain analyses as well as a stability model and hydrologic models.Also the engine gives access to the GRASS analysis modules.

THE STANDALONE MODE: The need for usage of the modelling environment on supercomputer defined a heavily decoupled design for the console engine. The framework defines a strict interface between GUI and analysis engine, which makes it easy to exploit the console engine in standalone mode on server-side.

The Horton Machine

Models

DEPLOYEMENT

R. Rigon with HydrologisWednesday, April 24, 13

88

The relationship to OMS3

OMS3THE OMS3 ENGINE: the console engine exposes a compiler for an OMS3 based modeling language.This gives a way to write scripts to execute openmi chained models.

THE OGC STANDARDS EXTENTION: The need for big vector and raster data forced the team to extend the OMS3 standard interfaces with two GIS OGC standards: the OGC feature modelthe OGC grid coverage service (in prototype mode) ‏

OGC IN JGRASS: the OGC feature and grid coverage models are served by the geotools libraries. The coverage model is based on the Java Advanced Imaging library and supports tilecaching for processing of large dataset. Coverage data are passed to native languages as C, C++ and Fortran through the easy adoptable JNA libraries.

The Horton MachineModels

DEPLOYEMENT

R. Rigon with HydrologisWednesday, April 24, 13

89

Not just an idea but a reality

The case of JGrass-NewAGE

The State Of Art of the Project

R. Rigon with Hydrologis and G. FormettaWednesday, April 24, 13

90Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23

5

Modelling with components GIS Integration Multi-platform

Multi-language Open-source Reproducible research system

NewAge Goals:

Motivation Outline Hydrological Components Modelling Framework Conclusions

Trento 19 April 2013 G. Formetta,

The State Of Art of the Project

R. Rigon with Hydrologis and G. FormettaWednesday, April 24, 13

91

The RRS concept

Since research and technical work rely on daily use of computer programs

•Models configurations•Models setup•Models input data•Models output•Results interpretation

Should be sharable in the easiest way

The State Of Art of the Project

R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13

92Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23

10

Model setting

Hillslope Features

Basin splitted in hillslopes

Outline Calibration Issues Data Assimilation Motivation Hydrological Component

Trento 17 June 2011 G. Formetta, Trento 24 June 2011

Outline Conclusions Informatic Structure Hydrological Components

Leipzig 05 July 2012 G. Formetta,

Motivation Outline Hydrological Components Modelling Framework Conclusions

Trento 19 April 2013 G. Formetta,

The State Of Art of the Project

Hydrologis, R. Rigon and G. FormettaWednesday, April 24, 13

93

Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23

11

Model setting

Network splitted in links

Links Features

Outline Calibration Issues Data Assimilation Motivation Hydrological Component

Trento 17 June 2011 G. Formetta, Trento 24 June 2011

Outline Calibration Issues Informatic Structure Hydrological Components

Leipzig 05 July 2012 G. Formetta,

Motivation Outline Hydrological Components Modelling Framework Conclusions

Trento 19 April 2013 G. Formetta,

The State Of Art of the Project

Hydrologis, R. Rigon and G. FormettaWednesday, April 24, 13

94Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23

16

Outline Calibration Issues Data Assimilation Motivation Hydrological Component

Trento 17 June 2011 G. Formetta, Trento 24 June 2011

Interpolation Problem Verification Procedure

Outline Calibration Issues Informatic Structure Hydrological Components

1) Start from a complete dataset

Outline Conclusions Informatic Structure Hydrological Components

Leipzig 05 July 2012 G. Formetta,

Motivation Outline Hydrological Components Modelling Framework Conclusions

Trento 19 April 2013 G. Formetta,

The State Of Art of the Project

R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13

95Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23

21

Precipitation Interpolation: Krigings

Motivation Outline Hydrological Components Modelling Framework Conclusions

Trento 19 April 2013 G. Formetta,

The State Of Art of the Project

R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13

96Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23

28

Shortwave Energy Model: raster mode application on Piave river

Simulation time step: hourly

Simulation Period: 01/10/201- 02/10/2010

Motivation Outline Hydrological Components Modelling Framework Conclusions

Trento 19 April 2013 G. Formetta,

The State Of Art of the Project

R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13

97Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23

29

NewAge-OMS3 automatic calibration algorithms

Generic Parameter set

Optimal Parameter set

Uncertainty: •  catchment heterogeneity •  model limitations •  measurement techniques

Motivation Outline Hydrological Components Modelling Framework Conclusions

Trento 19 April 2013 G. Formetta,

The State Of Art of the Project

R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13

98Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23

34

Outline Calibration Issues Data Assimilation Motivation Hydrological Component

Trento 17 June 2011 G. Formetta, Trento 24 June 2011

Outline Calibration Issues Informatic Structure Hydrological Components Outline Conclusions Informatic Structure Hydrological Components

Leipzig 05 July 2012 G. Formetta,

Basin Delineation Conclusions

Formetta G., ARS-USDA-Fort Collins (CO)

Motivation Hydrological Components

Formetta G., David O. and Rigon R.

Little Washita river basin: Rainfall-Runoff modelling solution

Motivation Outline Hydrological Components Modelling Framework Conclusions

Trento 19 April 2013 G. Formetta,

The State Of Art of the Project

R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13

99Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23

39

Something more than a “classical” model

Outline Calibration Issues Data Assimilation Motivation Hydrological Component

Rome 09 March 2011 Trento 17 June 2011 G. Formetta, Trento 24 June 2011

Different possibility to run OMS3 components

uDig 1.3.1 Spatial Toolbox

Trento 24 June 2011

Outline Calibration Issues Informatic Structure Hydrological Components Outline Conclusions Informatic Structure Hydrological Components

Leipzig 05 July 2012 G. Formetta,

Motivation Outline Hydrological Components Modelling Framework Conclusions

Trento 19 April 2013 G. Formetta,

The State Of Art of the Project

Hydrologis, R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13

100

Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23

40

Something more than a “classical” model

Outline Calibration Issues Data Assimilation Motivation Hydrological Component

Rome 09 March 2011 Trento 17 June 2011

uDig 1.3.1 Spatial Toolbox

OMS3 Console

Different possibility to run OMS3 components

Outline Calibration Issues Informatic Structure Hydrological Components Outline Conclusions Informatic Structure Hydrological Components

Leipzig 05 July 2012 G. Formetta,

Motivation Outline Hydrological Components Modelling Framework Conclusions

Trento 19 April 2013 G. Formetta,

The State Of Art of the Project

Hydrologis, R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13

101Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23

41

Something more than a “classical” model

Outline Calibration Issues Data Assimilation Motivation Hydrological Component

Rome 09 March 2011 Trento 17 June 2011 G. Formetta, Trento 24 June 2011

OMS3 Console

Command Line

uDig 1.3.1 Spatial Toolbox

Outline Calibration Issues Informatic Structure Hydrological Components Outline Conclusions Informatic Structure Hydrological Components

Leipzig 05 July 2012 G. Formetta,

Different possibility to run OMS3 components

Motivation Outline Hydrological Components Modelling Framework Conclusions

Trento 19 April 2013 G. Formetta,

The State Of Art of the Project

Hydrologis, R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13

102

Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23

42

Something more than a “classical” model

Outline Calibration Issues Data Assimilation Motivation Hydrological Component

Rome 09 March 2011 G. Formetta,

What is a .sim file?

Outline Calibration Issues Informatic Structure Hydrological Components Outline Conclusions Informatic Structure Hydrological Components

Leipzig 05 July 2012 G. Formetta,

Motivation Outline Hydrological Components Modelling Framework Conclusions

Trento 19 April 2013 G. Formetta,

The State Of Art of the Project

Hydrologis, R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13

103Formetta et al., CAHMDA IV Lhasa 2010 - July 21-23

43

The file structure is different respect to a common .sim file:

- Model: here the model has to be calibrated

- PSO Parameters: here have to be assigned

- Model Parameters to optimize: here have to be assigned

- Objective Function, Model output and measurements: here have to be assigned

Particle Swarm calibration .sim file

Outline Conclusions Informatic Structure Hydrological Components

Leipzig 05 July 2012 G. Formetta,

Motivation Outline Hydrological Components Modelling Framework Conclusions

Trento 19 April 2013 G. Formetta,

The State Of Art of the Project

R. Rigon, G. Formetta, and O. DavidWednesday, April 24, 13

104

EPILOGUE

OUR AIM IS NOT TO MODEL EVERYTHING*OR DO A MODEL OF EVERYTHING BUT GIVE A S P A C E W E R E D I F F E R E N T , E V E N CONTRADICTORY, IDEAS, AND DATA CAN BE EXPLOITED IN A WAY WHICH PROPELS COLLABORATIVE EFFORTS BY SCIENTISTS AND 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 Goal

R. Rigon, and the whole groupWednesday, April 24, 13

105

Direct 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 others

Erica Ghesla, Andrea Cozzini, Silvano Pisoni and others contributed to original version of the Horton Machine

Acknowledgements

R. RigonWednesday, April 24, 13

106

G.U

lric

i -

20

00

?

Thank you

R. RigonWednesday, April 24, 13


Recommended