24
logo2 Outline PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models and Numerical Methods for Environmental Problems. Part I: A Multilayer Convection Diffusion Model L. Ferragut IUFFyM, Universidad de Salamanca L. Ferragut A Multilayer Convection Diffusion Model

Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

Models and Numerical Methods for EnvironmentalProblems. Part I: A Multilayer Convection

Diffusion Model

L. Ferragut

IUFFyM, Universidad de Salamanca

L. Ferragut A Multilayer Convection Diffusion Model

Page 2: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

Convection Diffusion ModelChange of coordinates

Convection Diffusion Model

A

S

d

LLD

∂u

∂t+ V .∇xyu + W

∂u

∂z−∇xy (kxy∇xyu)−

∂z(kz

∂u

∂z) = f in Ω

−kxy∇xyu.ν|L = [V .ν]+u on L

−kz∂u

∂z= 0 on A

−kxy∇xyu.ν|S − kz∂u

∂z= 0 on S

u|t=0 = 0

L. Ferragut A Multilayer Convection Diffusion Model

Page 3: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

Convection Diffusion ModelChange of coordinates

Change of coordinates

We make a change of coordinates in order to transform the domaininto a cuboid.

τ = t

ξ = x

η = y

ς = z − h(x , y)

L. Ferragut A Multilayer Convection Diffusion Model

Page 4: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

Convection Diffusion ModelChange of coordinates

Then the convection term becomes

U∇u = V∇ξηu + (W − V1∂h

∂x− V2

∂h

∂y)∂u

∂ς

And the diffusion term is

−∇(k∇u) = − ∇ξη(kξη∇ξηu)

− ∂

∂ζ

((kζ + kξη(

∂h

∂x)2 + kξη(

∂h

∂y)2)∂u

∂ζ

)+

∂ξ(kξη

∂h

∂x

∂u

∂ζ) +

∂ζ(kξη

∂h

∂x

∂u

∂ξ)

+∂

∂η(kξη

∂h

∂y

∂u

∂ζ) +

∂ζ(kξη

∂h

∂y

∂u

∂η) (1)

L. Ferragut A Multilayer Convection Diffusion Model

Page 5: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

Splitting methods: General TheorySplitting method: A simplified Convection-Difussion problemA Finite Element - Characteristic - Finite Difference method

A Finite Element - Characteristic - Finite Differencemethod: Parallel implementation

Parallel LOOPFor l = 1, ...., LHorizontal Convection Diffusion

Non Parallel LOOPFor l = 1, ...., LVertical Convection Difussion and Crossed Derivatives

Non Parallel LOOPFor l = L, ...., 1Vertical Convection Difussion and Crossed Derivatives

Parallel LOOPFor l = L, ...., 1Horizontal Diffusion Convection

L. Ferragut A Multilayer Convection Diffusion Model

Page 6: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

Splitting methods: General TheorySplitting method: A simplified Convection-Difussion problemA Finite Element - Characteristic - Finite Difference method

A Finite Element - Characteristic - Finite Differencemethod: Parallel implementation

For l = 1, ...., L [Parallel LOOP]

un+1/6l − un

l

∆t/2= 0

un+1/3l − u

n+1/6l

∆t+

1

2Alu

n+1/3l

if (l == 1) +1

2λu

n+1/3l =

1

2f n+1/3

L. Ferragut A Multilayer Convection Diffusion Model

Page 7: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

Splitting methods: General TheorySplitting method: A simplified Convection-Difussion problemA Finite Element - Characteristic - Finite Difference method

A Finite Element - Characteristic - Finite Differencemethod: Parallel implementation

For l = 1, ...., L [Non Parallel LOOP]

un+1/2l − u

n+1/3l

∆t+

W +l

∆z(u

n+1/2l − u

n+1/2l−1 )

+ kz

−un+1/2l−1 + u

n+1/2l

(∆z)2

+1

2∆z(−Blu

n+1/2l−1 ) +

1

2∆z(−Clu

n+1/2l−1 ) = 0

L. Ferragut A Multilayer Convection Diffusion Model

Page 8: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

Splitting methods: General TheorySplitting method: A simplified Convection-Difussion problemA Finite Element - Characteristic - Finite Difference method

A Finite Element - Characteristic - Finite Differencemethod: Parallel implementation

For l = L, ...., 1 [Non Parallel LOOP]

un+2/3l − u

n+1/2l

∆t−

W−l

∆z(u

n+2/3l+1 − u

n+2/3l )

+ kz

un+2/3l − u

n+2/3l+1

(∆z)2

+1

2∆z(Blu

n+2/3l+1 ) +

1

2∆z(Clu

n+2/3l+1 ) = 0

L. Ferragut A Multilayer Convection Diffusion Model

Page 9: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

Splitting methods: General TheorySplitting method: A simplified Convection-Difussion problemA Finite Element - Characteristic - Finite Difference method

A Finite Element - Characteristic - Finite Differencemethod: Parallel implementation

For l = L, ...., 1 [Parallel LOOP]

un+5/6l − u

n+2/3l

∆t+

1

2Alu

n+5/6l

if (l == 1) +1

2λu

n+5/6l =

1

2f n+5/6

un+1l − u

n+5/6l

∆t/2= 0

L. Ferragut A Multilayer Convection Diffusion Model

Page 10: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

Numerical Examples

Figure: velocity fieldL. Ferragut A Multilayer Convection Diffusion Model

Page 11: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

f (t, x) = ae−( log(2)c

t)e−((X [0]−x[0])2+(X [1]−x[1])2)/(2b2))

t is the time in seconds

a = 100 pre-exponential factor.

b = 100 is the standar deviation of the gaussian distribution

c = 300 is the half life time of the emision in seconds.

X = [500, 4500]t is the point where the emision takes place.

The other physical values are

Horizontal Diffusion kxy = 10−1

Vertical Diffusion kz = 10−3

Absortion coefficient in the surface level λ = 0.001

L. Ferragut A Multilayer Convection Diffusion Model

Page 12: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

Figure: Concentration in the first level at different time steps

L. Ferragut A Multilayer Convection Diffusion Model

Page 13: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

Figure: Concentration in the third level at different time steps

L. Ferragut A Multilayer Convection Diffusion Model

Page 14: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

logo2

OutlinePRESENTATION

Numerical MethodSplitting algoritmsNumerical Results

Parallel perfomances

Parallel perfomances

threads/layers Run Time (s) Secuential Time (s) Red. factor

4 37 306 8.27

8 61 856 14.03

16 94 2867 30.5

24 106 5260 35

Table: Run times up to 24 layers. Real Time: 1 Hour

L. Ferragut A Multilayer Convection Diffusion Model

Page 15: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

Outline INTRODUCTION REFERENCE MODEL SIMPLIFIED PHYSICAL MODELS NUMERICAL METHODS NUMERICAL RESULTS Real examples: Integration in a Forest Fire Decision System Simulations

Models and Numerical Methods for EnvironmentalProblems. Part III: Fire Propagation Models

L. Ferragut

IUFFyM, Universidad de Salamanca

L. Ferragut Fire Models

Page 16: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

Outline INTRODUCTION REFERENCE MODEL SIMPLIFIED PHYSICAL MODELS NUMERICAL METHODS NUMERICAL RESULTS Real examples: Integration in a Forest Fire Decision System SimulationsThe goal Effect of the water content: Enthalpy operator Apendix: Multivalued Operators Radiation 1D-Example Local approximation Model with non local radiation

Model with non local radiation

The non dimensional equations governing the fire spread in aregion Ω are,

1 ∂te + αu = r(u, y)

2 e ∈ G (u)

3 ∂ty = −g(u)y

r(u, y) is the source term

G (u) is the Enthalpy

g(u)y is the rate of pyrolysis

L. Ferragut Fire Models

Page 17: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

Outline INTRODUCTION REFERENCE MODEL SIMPLIFIED PHYSICAL MODELS NUMERICAL METHODS NUMERICAL RESULTS Real examples: Integration in a Forest Fire Decision System SimulationsThe goal Effect of the water content: Enthalpy operator Apendix: Multivalued Operators Radiation 1D-Example Local approximation Model with non local radiation

Comments

Comments

Local diffusion has been neglected

Effects of the WATER CONTENT are considered

Main mechanism of fuel heating is RADIATION (non localdiffusion)

Convection has been neglected but main WIND EFFECTS areconsidered via radiation model

Gas phase is parametrized (The temperature and height of theflame are parameters)

L. Ferragut Fire Models

Page 18: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

Outline INTRODUCTION REFERENCE MODEL SIMPLIFIED PHYSICAL MODELS NUMERICAL METHODS NUMERICAL RESULTS Real examples: Integration in a Forest Fire Decision System SimulationsLocal radiation model Iterative Solution at each Time Step Non local radiation model Time Integration Solution at each time step Computation of the radiation term Computation of the radiation term Wind Model

Computation of Radiation

Consider any defined flame shape

A ray passing through the flame

The total radiation at the surface

Integrate through all possible solid angles ω

r(x) =

∫ 2π

ω=0i(x,Ω)Ω.n dω

L. Ferragut Fire Models

Page 19: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

Outline INTRODUCTION REFERENCE MODEL SIMPLIFIED PHYSICAL MODELS NUMERICAL METHODS NUMERICAL RESULTS Real examples: Integration in a Forest Fire Decision System SimulationsExample 2: Parallel computing perfomance of the radiation term Example 3: Comparison with Fire Analyst Physical and numerical data

parallel efficiency

Number of threads Run Time (seconds) Acceleration efficiency

1 3.798 1 100%

4 1.110 3,42 86%

8 681 5,57 70%

16 687 5,53 35%

Table: Run times and efficienty for eight directions of numericalintegration

L. Ferragut Fire Models

Page 20: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

Outline INTRODUCTION REFERENCE MODEL SIMPLIFIED PHYSICAL MODELS NUMERICAL METHODS NUMERICAL RESULTS Real examples: Integration in a Forest Fire Decision System SimulationsExample 2: Parallel computing perfomance of the radiation term Example 3: Comparison with Fire Analyst Physical and numerical data

parallel efficiency

Number of threads Run Time (seconds) Acceleration efficiency

1 12.265 1 100%

4 3.220 3,81 95%

8 1.770 6,93 87%

16 1.606 7,64 48%

Table: Run times and efficienty for sixteen directions of numericalintegration

L. Ferragut Fire Models

Page 21: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

Outline INTRODUCTION REFERENCE MODEL SIMPLIFIED PHYSICAL MODELS NUMERICAL METHODS NUMERICAL RESULTS Real examples: Integration in a Forest Fire Decision System SimulationsExample 2: Parallel computing perfomance of the radiation term Example 3: Comparison with Fire Analyst Physical and numerical data

An example: Andalucıa (Spain)

Figure: Fire Analyst Figure: Physical Model

Data by courtesy of Tecnosylva, S.L. Leon, Spain

L. Ferragut Fire Models

Page 22: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

Introducción Formulación matemática en términos del concepto espacio-estado

Solución recursiva Solución válida para ambientes estacionarios y no estacionarios

Soporta estimas de estados presentes, pasados y futuros (filtrado,suavizado y predicción)

Método eficiente para resolver el problema de mínimos cuadrados (incluye al RLS y sus variantes)

Estado x(t) Observación z(t)Estima del estado x(t)

Errores del sistema Errores de medida Información previa

Filtro de Kalman discreto (recordando de nuevo)

Algoritmo recursivo de procesamiento de datos, que bajo ciertas condiciones permite estimar el estado de un sistema en forma óptima.

Proporciona el estimador óptimo del estado X, dado un conjunto de medidas Z.

Condiciones-Restricciones:

El sistema es Lineal Ruidos asociados al modelo del proceso y al de las

mediciones: Blancos y Gaussianos.

Filtro de Kalman Discreto

• Ecuaciones del sistema dinámico (Ecuación de estado):

xk = Axk-1 + Buk-1+wk-1

• Ecuaciones del sistema de medidas:

zk = Hxk+vk

Notación y restricciones

•Xk: posición en tiempo k (estado)

•Uk: señal de entrada al sistema (acciones de control)

•Zk: mediciones en tiempo k (datos de los sensores)

•w y v se asumen independientes.

Page 23: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

Filtro de Kalman (generalización)

Se asume que poseen las siguientes distribuciones :

W corresponde al ruido del proceso con covarianza Q.

V corresponde al ruido en la medición con covarianza R.

*** A, B, y H podrían cambiar en el tiempo, pero

asumimos en la presentación que son constantes.

Filtro de Kalman (generalización)• Definiciones, notaciones y descripción del algoritmo de predicción-corrección:

PASO 1: PREDICCIÓN

• Estimador a priori del estado, i.e. en función del conocimiento del proceso previo al paso k:

PASO 2: CORRECCIÓN

• Estimador a posteriori del estado, i.e. en función de los pasos hasta k y de la NUEVA medición efectuada en el paso k:

Filtro de Kalman (generalización)

Matrices de covarianza a priori y a posteriori asociadas:

ERRORES de las estimaciones a priori y a posteriori:

Recordando las ideas del primer ejemplo

Objetivo: Encontrar una expresión para el estimador a posteriori del estado como una combinación lineal del estimador a priori del estado y la diferencia entre la medida actual y la predicción de la medida:

(*)

corresponde al residuo o innovación de la medición.

¿¿¿¿CCCCóóóómo elegir K?mo elegir K?mo elegir K?mo elegir K?

Page 24: Models and Numerical Methods for Environmental Problems. Part … · 2010. 11. 16. · PRESENTATION Numerical Method Splitting algoritms Numerical Results Parallel perfomances Models

Generalizando..

El objetivo es encontrar K tal que se minimice la El objetivo es encontrar K tal que se minimice la El objetivo es encontrar K tal que se minimice la El objetivo es encontrar K tal que se minimice la covarianzacovarianzacovarianzacovarianza del error a posteriori.del error a posteriori.del error a posteriori.del error a posteriori.

Es posible encontrar una expresiEs posible encontrar una expresiEs posible encontrar una expresiEs posible encontrar una expresióóóón para K n para K n para K n para K reemplazando (*) en la expresireemplazando (*) en la expresireemplazando (*) en la expresireemplazando (*) en la expresióóóón del error n del error n del error n del error eeeekkkk y y y y luego en la expresiluego en la expresiluego en la expresiluego en la expresióóóón de la n de la n de la n de la covarianzacovarianzacovarianzacovarianza del error a del error a del error a del error a posteriori. posteriori. posteriori. posteriori. ““““Minimizando dicha expresiMinimizando dicha expresiMinimizando dicha expresiMinimizando dicha expresióóóón se n se n se n se encuentra Kencuentra Kencuentra Kencuentra K””””....

Filtro de Kalman (generalizando..)Operando segOperando segOperando segOperando segúúúún lo descrito, se obtendrn lo descrito, se obtendrn lo descrito, se obtendrn lo descrito, se obtendríííían las siguientes ecuaciones de an las siguientes ecuaciones de an las siguientes ecuaciones de an las siguientes ecuaciones de

recurrencia:recurrencia:recurrencia:recurrencia:

Filtro de Kalman

Observaciones (*** Hay coherencia en los resultados ???):(*** Hay coherencia en los resultados ???):(*** Hay coherencia en los resultados ???):(*** Hay coherencia en los resultados ???):

1. Si la covarianza del error en la medición se aproxima a cero, la ganancia K otorga mayor peso a la innovación de la medición, i.e. se confía más en la medición:

2. Si el estimador a priori de la covarianza del error se aproxima a cero, la ganancia K otorga menor importancia a la innovación de la medición.

FK: Algoritmo de predicción-corrección