Upload
nieve
View
26
Download
0
Tags:
Embed Size (px)
DESCRIPTION
World Environmental and Water Resources Congress Palm Springs, May 23, 2011. Using Software Quality and Algorithm Testing to Verify a 1-Dimensional Transport Model. Kaveh Zamani Fabian Bombardelli. Eli Ateljevich Jamie Anderson. Modeling Support Branch, Bay-Delta Office - PowerPoint PPT Presentation
Citation preview
Using Software Quality and Algorithm Testing
to Verify a 1-Dimensional
Transport Model
World Environmental and Water Resources CongressPalm Springs, May 23, 2011
Kaveh Zamani
Fabian Bombardelli
Eli Ateljevich
Jamie Anderson
Modeling Support Branch, Bay-Delta OfficeDepartment of Water Resources
Civil & Environmental Engineering Dept.University of California, Davis
2
Verification: how to find a bug in a forest?
3
There were 8/12 serious static faults per 1000 lines of executable files in C/Fortran! (SAND 2002-0529)
How to develop a fully testable and tested transport code?
This Talk:
1. STM (Sediment and Transport Module)
2. Software testing
3. Verification measures
4. Transport test suite
5. Challenges
6. Result
4
STM:Software testing: Verification:Transport test: Challenges:Results :
Governing Equation and Solution Algorithm
5
iii
i
ii
SinkSourcex
CAD
x
x
AUC
t
AC
)()(
Operator splitting to combine:
• Modified Lax Two Step method + ODE integrator (Advection, Reaction )
• Crank- Nicolson in FVM framework (Dispersion)
HYDROHydrodynamic
HYDROHydrodynamic
QUAL1-D fate and
transport
QUAL1-D fate and
transport
PTMQuasi 3-D particle
Tracking
PTMQuasi 3-D particle
Tracking
Structure of Delta Simulation Model 2 (DSM2)
STM1-D sediment
transport model
STM1-D sediment
transport model
6
Modular design Applicable in tidal environments Generalize Eulerian transport solver that
could be adapted to other constituents Second order accuracy Shock capturing Mass conservative Well tested Associated dynamic testing for
development
STM:Software testing: Verification:Transport test: Challenges:Results :
STM Project Goals
7STM=Sediment and Transport Module
• Each function in STM has tests
• Code and analytical tests
• Each test puts light of a part
• Test wide range of scenarios
• Test for bad/incomplete input
• Produce report of pass/fail result
• Run tests regularly
(Fortran Unit Test Framework)
STM:Software testing: Verification:Transport test: Challenges:Results :
STM Code Testing
8
Testing versus analytical solution1. Richardson Extrapolation2. Method of Manufactured Solution 3. Prescribed Forcing Method4. Perturbation 5. Using symmetry 6. Error analysis 7. Dense mesh solution
STM:Software testing: Verification:Transport test: Challenges:Results :
Convergence
9
No! They are brutal. They expose bugs. But they leave behind some bugs as well.
Grid Size
Err
or
1
Nominal scheme’s order of accuracy (2)
1 1
A
B
a b
2≈a > b
After Leveque, 2002
STM:Software testing: Verification:Transport test: Challenges:Results :
Are convergence tests enough?
10Adapted from Oberkampf and Trucano, 2002
STM:Software testing: Verification:Transport test: Challenges:Results :
Transport Test Suite
11
1. Boundary values: remote Active2. Flow field and coefficients: constant Variable3. Single process Double process Triple process
2nd order accuracy
STM:Software testing: Verification:Transport test: Challenges:Results :
Incremental nature of the tests
12
STM:Software testing: Verification:Transport test: Challenges:Results :
Layering in complexity
13
STM:Software testing: Verification:Transport test: Challenges:Results :
Layering in complexity
14
STM:Software testing: Verification:Transport test: Challenges:Results :
Layering in complexity
15
STM:Software testing: Verification:Transport test: Challenges:Results :
Layering in complexity
16
STM:Software testing: Verification:Transport test: Challenges:Results :
Layering in complexity
17
1. Considering error distribution
2. Dimensionless numbers of natural phenomena
3. Preserving the basic shape4. Oscillation5. Smoothness of initial
condition6. Non-linear/stiff source
termGrid Size
Err
or Machine precisionexceeds round off
error
Computer precision
1
Order of Converge
IIIIII
STM:Software testing: Verification:Transport test: Challenges:Results :
General consideration
18
0.0
0.2
0.4
0.6
0.8
1.0 Initial
t=T/4
t=T/4 Model
t=T/2
t=T/2 Model
t=3T/4
t=3T/4 Model
t=T
t=T Model
Channel Length (0 to L)
Con
cent
ratio
n (V
ol/V
ol) Lag
2Lag
Lag
STM:Software testing: Verification:Transport test: Challenges:Results :
Logical error in Advection-Reaction
19
BffAufAu 1 hh Be
hhh BBe
• In boundary cells, local reduction up to 2 order does not reduce the global convergence rate.
• Inside the domain cells, local reduction up to 1 order does not reduce global convergence rate.
2
...),(...
x
jiC
✔
2
...),1(...
x
jiC
STM:Software testing: Verification:Transport test: Challenges:Results :
Syntax error in Diffusion
20
40,000 45,000 50,000 55,000 60,000 65,000 70,0000.0
0.4
0.8
1.2
1.6
2.0C(t=0)C(t=T/4)C(t=T/2)C(t=3T/4)C(t=T)Exact
Channel Length (m)
Co
nce
ntr
atio
n (
V/V
)
STM:Software testing: Verification:Transport test: Challenges:Results :
Example Advection Reaction, Tidal Flow
21
We developed a step by step roadmap for complete verification of a transport code
Approximately 350 tests - 280 unit tests and 70 system/algorithm tests are there.
We designed a really complete test suite May help solve the “grey literature” issue in testing
transport Methods of Computer Science are there to guarantee the
results in computational fluid mechanics STM is, an open source, well tested, and nice
bedrock for further development
STM:Software testing: Verification:Transport test: Challenges:Results :
Accomplishments and final remarks
Analog Delta Model
Thank You
Kaveh Zamani: [email protected]
Fabian Bombardelli, PhD: [email protected]
Eli Ateljevich, PhD, PE: [email protected]
Jamie Anderson, PhD, PE: [email protected]
22