Python 3 stochastic Galerkin shallow flow model with well-balancing, wetting-and-drying, and uncertain friction and topography
Description
This Python 3 code includes
- a one-dimensional shallow flow model which can be configured as an intrusive or nonintrusive stochastic model;
- preconfigured steady-state flow, lake-at-rest, and dam break test cases.
First ensure that Python 3, NumPy and SciPy are installed. Then, install the stochastic Galerkin library and the shallow flow models:
pip3 install --user --editable pysg
pip3 install --user --editable pysgswe
To run the intrusive model:
pysgswe-intrusive <outputDir> <testCase> <basis> --max-basis <integer>
where testCase
is either criticalSteadyState
, lakeAtRest
, flumeFriction
or flumeFrictionTopography
,# basis
is either haar
or hermite
, and the --max-basis
value is the maximum refinement level L or Hermite polynomial order P, according to the choice of basis. For test cases involving two sources of uncertainty, the flag --basis-dimensions 2
must also be included. A tensor product basis is used unless --truncate-basis
is specified. Running the nonintrusive model follows a similar procedure:
pysgswe-nonintrusive <outputDir> <testCase> --max-level <integer>
where --max-level
specifies the maximum refinement level. Note that the nonintrusive model can only be used with a Wiener–Haar basis. Other command line options are the same as for the intrusive model.
Files
pysgswe.zip
Files
(33.5 kB)
Name | Size | Download all |
---|---|---|
md5:e87e32785a8c281047cfa309703bfcab
|
33.5 kB | Preview Download |