firts commit
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
[env]
|
||||||
|
CMAKE_POLICY_VERSION_MINIMUM = "3.5"
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
# Rust build artifacts
|
||||||
|
/target/
|
||||||
|
|
||||||
|
# Generated simulation outputs
|
||||||
|
/res/
|
||||||
|
/*.h5
|
||||||
|
/*.csv
|
||||||
|
/*.dat
|
||||||
|
|
||||||
|
# Local/editor files
|
||||||
|
/.idea/
|
||||||
|
/.vscode/
|
||||||
|
*.swp
|
||||||
|
*~
|
||||||
|
|
||||||
|
# OS metadata
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
Generated
+748
@@ -0,0 +1,748 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "aho-corasick"
|
||||||
|
version = "1.1.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
|
||||||
|
dependencies = [
|
||||||
|
"memchr",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "approx"
|
||||||
|
version = "0.5.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6"
|
||||||
|
dependencies = [
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ascii"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "autocfg"
|
||||||
|
version = "1.5.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bio-convect"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"csv",
|
||||||
|
"hdf5-metno",
|
||||||
|
"ndarray",
|
||||||
|
"ndarray-stats",
|
||||||
|
"pdifflib",
|
||||||
|
"pdifflib_derive",
|
||||||
|
"queues",
|
||||||
|
"serde",
|
||||||
|
"toml",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bitflags"
|
||||||
|
version = "2.13.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bytemuck"
|
||||||
|
version = "1.25.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cfg-if"
|
||||||
|
version = "1.0.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "csv"
|
||||||
|
version = "1.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "52cd9d68cf7efc6ddfaaee42e7288d3a99d613d4b50f76ce9827ae0c6e14f938"
|
||||||
|
dependencies = [
|
||||||
|
"csv-core",
|
||||||
|
"itoa",
|
||||||
|
"ryu",
|
||||||
|
"serde_core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "csv-core"
|
||||||
|
version = "0.1.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "704a3c26996a80471189265814dbc2c257598b96b8a7feae2d31ace646bb9782"
|
||||||
|
dependencies = [
|
||||||
|
"memchr",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "either"
|
||||||
|
version = "1.16.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "equivalent"
|
||||||
|
version = "1.0.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "getrandom"
|
||||||
|
version = "0.2.17"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"libc",
|
||||||
|
"wasi",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hashbrown"
|
||||||
|
version = "0.12.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hashbrown"
|
||||||
|
version = "0.17.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hdf5-metno"
|
||||||
|
version = "0.13.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "845de82d327e55f72a16db43ddc875ad3b1dc8f8b5860b9df135851c5f4e11a3"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"cfg-if",
|
||||||
|
"hdf5-metno-derive",
|
||||||
|
"hdf5-metno-sys",
|
||||||
|
"hdf5-metno-types",
|
||||||
|
"libc",
|
||||||
|
"ndarray",
|
||||||
|
"pastey",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hdf5-metno-derive"
|
||||||
|
version = "0.10.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5071e6eb3474ce3c38c2e6e01061c4224e49be8314b11ea8cad97a70efaa000a"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro-crate",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.118",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hdf5-metno-sys"
|
||||||
|
version = "0.12.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5588d150d10fc4ef9407c5b9f01735e3de0d71367b730b940cbd5be08f3e1d82"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"libloading",
|
||||||
|
"parking_lot",
|
||||||
|
"pkg-config",
|
||||||
|
"regex",
|
||||||
|
"serde",
|
||||||
|
"serde_derive",
|
||||||
|
"winreg",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hdf5-metno-types"
|
||||||
|
version = "0.11.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b29041af7e5a0b5698d6607c5c8b67b5dfcab40eb89c2fcfec54bbf0c031b425"
|
||||||
|
dependencies = [
|
||||||
|
"ascii",
|
||||||
|
"cfg-if",
|
||||||
|
"hdf5-metno-sys",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "indexmap"
|
||||||
|
version = "1.9.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
|
||||||
|
dependencies = [
|
||||||
|
"autocfg",
|
||||||
|
"hashbrown 0.12.3",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "indexmap"
|
||||||
|
version = "2.14.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
|
||||||
|
dependencies = [
|
||||||
|
"equivalent",
|
||||||
|
"hashbrown 0.17.1",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itertools"
|
||||||
|
version = "0.10.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
|
||||||
|
dependencies = [
|
||||||
|
"either",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itoa"
|
||||||
|
version = "1.0.18"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libc"
|
||||||
|
version = "0.2.186"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libloading"
|
||||||
|
version = "0.8.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"windows-link",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lock_api"
|
||||||
|
version = "0.4.14"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
|
||||||
|
dependencies = [
|
||||||
|
"scopeguard",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "matrixmultiply"
|
||||||
|
version = "0.3.10"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08"
|
||||||
|
dependencies = [
|
||||||
|
"autocfg",
|
||||||
|
"rawpointer",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "memchr"
|
||||||
|
version = "2.8.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nalgebra"
|
||||||
|
version = "0.31.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "20bd243ab3dbb395b39ee730402d2e5405e448c75133ec49cc977762c4cba3d1"
|
||||||
|
dependencies = [
|
||||||
|
"approx",
|
||||||
|
"matrixmultiply",
|
||||||
|
"nalgebra-macros",
|
||||||
|
"num-complex",
|
||||||
|
"num-rational",
|
||||||
|
"num-traits",
|
||||||
|
"simba",
|
||||||
|
"typenum",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nalgebra-macros"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 1.0.109",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ndarray"
|
||||||
|
version = "0.15.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32"
|
||||||
|
dependencies = [
|
||||||
|
"matrixmultiply",
|
||||||
|
"num-complex",
|
||||||
|
"num-integer",
|
||||||
|
"num-traits",
|
||||||
|
"rawpointer",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ndarray-stats"
|
||||||
|
version = "0.5.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "af5a8477ac96877b5bd1fd67e0c28736c12943aba24eda92b127e036b0c8f400"
|
||||||
|
dependencies = [
|
||||||
|
"indexmap 1.9.3",
|
||||||
|
"itertools",
|
||||||
|
"ndarray",
|
||||||
|
"noisy_float",
|
||||||
|
"num-integer",
|
||||||
|
"num-traits",
|
||||||
|
"rand",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "noisy_float"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c16843be85dd410c6a12251c4eca0dd1d3ee8c5725f746c4d5e0fdcec0a864b2"
|
||||||
|
dependencies = [
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-complex"
|
||||||
|
version = "0.4.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
|
||||||
|
dependencies = [
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-integer"
|
||||||
|
version = "0.1.46"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
|
||||||
|
dependencies = [
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-rational"
|
||||||
|
version = "0.4.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
|
||||||
|
dependencies = [
|
||||||
|
"num-integer",
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-traits"
|
||||||
|
version = "0.2.19"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
|
||||||
|
dependencies = [
|
||||||
|
"autocfg",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "parking_lot"
|
||||||
|
version = "0.12.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
|
||||||
|
dependencies = [
|
||||||
|
"lock_api",
|
||||||
|
"parking_lot_core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "parking_lot_core"
|
||||||
|
version = "0.9.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"libc",
|
||||||
|
"redox_syscall",
|
||||||
|
"smallvec",
|
||||||
|
"windows-link",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "paste"
|
||||||
|
version = "1.0.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pastey"
|
||||||
|
version = "0.2.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pdifflib"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"csv",
|
||||||
|
"hdf5-metno",
|
||||||
|
"nalgebra",
|
||||||
|
"ndarray",
|
||||||
|
"ndarray-stats",
|
||||||
|
"queues",
|
||||||
|
"serde",
|
||||||
|
"toml",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pdifflib_derive"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.118",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pkg-config"
|
||||||
|
version = "0.3.33"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ppv-lite86"
|
||||||
|
version = "0.2.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
|
||||||
|
dependencies = [
|
||||||
|
"zerocopy",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro-crate"
|
||||||
|
version = "3.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f"
|
||||||
|
dependencies = [
|
||||||
|
"toml_edit",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro2"
|
||||||
|
version = "1.0.106"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "queues"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1475abae4f8ad4998590fe3acfe20104f0a5d48fc420c817cd2c09c3f56151f0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quote"
|
||||||
|
version = "1.0.46"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rand"
|
||||||
|
version = "0.8.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"rand_chacha",
|
||||||
|
"rand_core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rand_chacha"
|
||||||
|
version = "0.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
|
||||||
|
dependencies = [
|
||||||
|
"ppv-lite86",
|
||||||
|
"rand_core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rand_core"
|
||||||
|
version = "0.6.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
||||||
|
dependencies = [
|
||||||
|
"getrandom",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rawpointer"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "redox_syscall"
|
||||||
|
version = "0.5.18"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex"
|
||||||
|
version = "1.13.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2a0e75113e14dc5acb068cd0786884f214f1312650a3d36d269f5c4f3cdee8a2"
|
||||||
|
dependencies = [
|
||||||
|
"aho-corasick",
|
||||||
|
"memchr",
|
||||||
|
"regex-automata",
|
||||||
|
"regex-syntax",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex-automata"
|
||||||
|
version = "0.4.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1f388202e4b80542a0921078cc23b6333bcf1409c1e3f86404cae4766a6131db"
|
||||||
|
dependencies = [
|
||||||
|
"aho-corasick",
|
||||||
|
"memchr",
|
||||||
|
"regex-syntax",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex-syntax"
|
||||||
|
version = "0.8.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ryu"
|
||||||
|
version = "1.0.23"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "safe_arch"
|
||||||
|
version = "0.7.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "scopeguard"
|
||||||
|
version = "1.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde"
|
||||||
|
version = "1.0.228"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
||||||
|
dependencies = [
|
||||||
|
"serde_core",
|
||||||
|
"serde_derive",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_core"
|
||||||
|
version = "1.0.228"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
||||||
|
dependencies = [
|
||||||
|
"serde_derive",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_derive"
|
||||||
|
version = "1.0.228"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.118",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "simba"
|
||||||
|
version = "0.7.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2f3fd720c48c53cace224ae62bef1bbff363a70c68c4802a78b5cc6159618176"
|
||||||
|
dependencies = [
|
||||||
|
"approx",
|
||||||
|
"num-complex",
|
||||||
|
"num-traits",
|
||||||
|
"paste",
|
||||||
|
"wide",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "smallvec"
|
||||||
|
version = "1.15.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syn"
|
||||||
|
version = "1.0.109"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syn"
|
||||||
|
version = "2.0.118"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "toml"
|
||||||
|
version = "0.5.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "toml_datetime"
|
||||||
|
version = "1.1.1+spec-1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7"
|
||||||
|
dependencies = [
|
||||||
|
"serde_core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "toml_edit"
|
||||||
|
version = "0.25.12+spec-1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d2153edc6955a6c354fad8f5efd38b6a8769bdccf9fe50f8e1329f81b0baa5d7"
|
||||||
|
dependencies = [
|
||||||
|
"indexmap 2.14.0",
|
||||||
|
"toml_datetime",
|
||||||
|
"toml_parser",
|
||||||
|
"winnow",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "toml_parser"
|
||||||
|
version = "1.1.2+spec-1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526"
|
||||||
|
dependencies = [
|
||||||
|
"winnow",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "typenum"
|
||||||
|
version = "1.20.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-ident"
|
||||||
|
version = "1.0.24"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasi"
|
||||||
|
version = "0.11.1+wasi-snapshot-preview1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wide"
|
||||||
|
version = "0.7.33"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
"safe_arch",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-link"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-sys"
|
||||||
|
version = "0.61.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
||||||
|
dependencies = [
|
||||||
|
"windows-link",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winnow"
|
||||||
|
version = "1.0.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1"
|
||||||
|
dependencies = [
|
||||||
|
"memchr",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winreg"
|
||||||
|
version = "0.56.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7d6f32a0ff4a9f6f01231eb2059cc85479330739333e0e58cadf03b6af2cca10"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"serde",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zerocopy"
|
||||||
|
version = "0.8.54"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b7cbbc0a705a0fd05cc3676525980d2bf5a9bc4adac6d6475209a7887cf59d19"
|
||||||
|
dependencies = [
|
||||||
|
"zerocopy-derive",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zerocopy-derive"
|
||||||
|
version = "0.8.54"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.118",
|
||||||
|
]
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
[package]
|
||||||
|
name = "bio-convect"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
pdifflib={version= '0.1.0',path="../pdifflib"}
|
||||||
|
pdifflib_derive={version= '0.1.0',path="../pdifflib_derive"}
|
||||||
|
ndarray = "0.15.1"
|
||||||
|
ndarray-stats = "0.5.0"
|
||||||
|
queues = "1.0.2"
|
||||||
|
|
||||||
|
csv = "1.1"
|
||||||
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
toml = "0.5.2"
|
||||||
|
hdf5 = { package = "hdf5-metno", version = "0.13.0" }
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
ID = 0
|
||||||
|
CreatedAt = 2026-07-11T12:52:12.752206984+05:00
|
||||||
|
UpdatedAt = 2026-07-11T12:52:12.752206984+05:00
|
||||||
|
rel = 1700.0
|
||||||
|
rel_c = 1.0
|
||||||
|
le = 1.0
|
||||||
|
pr = 1.0
|
||||||
|
pe = 1.0
|
||||||
|
ma = 0.0
|
||||||
|
time = 10.0
|
||||||
|
|
||||||
|
[DeletedAt]
|
||||||
|
Time = 0001-01-01T00:00:00Z
|
||||||
|
Valid = false
|
||||||
@@ -0,0 +1,184 @@
|
|||||||
|
use crate::{H, NX, NY, PEREODIC};
|
||||||
|
use ndarray::Array2;
|
||||||
|
use pdifflib::field::{Field2D, Grid};
|
||||||
|
use pdifflib::finit_diff::poisson_relax;
|
||||||
|
use pdifflib::{dx, dx_b, dx_f, dy, dy_b, dy_f, jacobian, lap, mx_b, my_b};
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Copy, Clone, Debug)]
|
||||||
|
pub struct Params {
|
||||||
|
pub rel: f64,
|
||||||
|
pub rel_c: f64,
|
||||||
|
pub le: f64,
|
||||||
|
pub pr: f64,
|
||||||
|
pub pe: f64,
|
||||||
|
pub ma: f64,
|
||||||
|
pub time: f64,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct TemperatureEquation {
|
||||||
|
grid: Grid,
|
||||||
|
delta: Array2<f64>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TemperatureEquation {
|
||||||
|
pub fn new(nx: usize, ny: usize) -> Self {
|
||||||
|
Self {
|
||||||
|
grid: Grid::new(nx, ny),
|
||||||
|
delta: Array2::<f64>::zeros((nx, ny)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn step(&mut self, temp: &mut Array2<f64>, psi: &Array2<f64>, dt: f64) {
|
||||||
|
let inv_h2 = 1.0 / (H * H);
|
||||||
|
for (i, j) in self.grid.inner_nodes() {
|
||||||
|
self.delta[[i, j]] = dt * inv_h2 * (lap!(temp, i, j) + jacobian!(psi, temp, i, j));
|
||||||
|
}
|
||||||
|
*temp += &self.delta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PhiEquation {
|
||||||
|
grid: Grid,
|
||||||
|
delta: Array2<f64>,
|
||||||
|
rel: f64,
|
||||||
|
pr: f64,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PhiEquation {
|
||||||
|
pub fn new(nx: usize, ny: usize, rel: f64, pr: f64) -> Self {
|
||||||
|
Self {
|
||||||
|
grid: Grid::new(nx, ny),
|
||||||
|
delta: Array2::<f64>::zeros((nx, ny)),
|
||||||
|
rel,
|
||||||
|
pr,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn step(
|
||||||
|
&mut self,
|
||||||
|
phi: &mut Array2<f64>,
|
||||||
|
psi: &Array2<f64>,
|
||||||
|
temp: &Array2<f64>,
|
||||||
|
dt: f64,
|
||||||
|
) {
|
||||||
|
let inv_h = 1.0 / H;
|
||||||
|
let inv_h2 = inv_h * inv_h;
|
||||||
|
let pr = self.pr;
|
||||||
|
for (i, j) in self.grid.inner_nodes() {
|
||||||
|
let archim = self.rel * dx!(temp, i, j);
|
||||||
|
let tmp = pr * (lap!(phi, i, j) * inv_h2 + archim * inv_h)
|
||||||
|
+ jacobian!(psi, phi, i, j) * inv_h2;
|
||||||
|
self.delta[[i, j]] = tmp * dt;
|
||||||
|
}
|
||||||
|
*phi += &self.delta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PsiEquation;
|
||||||
|
|
||||||
|
impl PsiEquation {
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn step(&mut self, psi: &mut Array2<f64>, phi: &Array2<f64>) {
|
||||||
|
poisson_relax(&phi, psi, H, PEREODIC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ConcentrationEquation {
|
||||||
|
grid: Grid,
|
||||||
|
qew: Array2<f64>,
|
||||||
|
qsn: Array2<f64>,
|
||||||
|
vx: Array2<f64>,
|
||||||
|
vy: Array2<f64>,
|
||||||
|
pe: f64,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ConcentrationEquation {
|
||||||
|
pub fn new(nx: usize, ny: usize, pe: f64) -> Self {
|
||||||
|
Self {
|
||||||
|
grid: Grid::new(nx, ny),
|
||||||
|
qew: Array2::<f64>::zeros((nx, ny)),
|
||||||
|
qsn: Array2::<f64>::zeros((nx, ny)),
|
||||||
|
vx: Array2::<f64>::zeros((nx, ny)),
|
||||||
|
vy: Array2::<f64>::zeros((nx, ny)),
|
||||||
|
pe,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn step(&mut self, conc: &mut Field2D, psi: &Field2D, _temp: &Field2D, dt: f64) {
|
||||||
|
self.calc_v(psi);
|
||||||
|
|
||||||
|
let grid = self.grid;
|
||||||
|
for (i, k) in grid.x_faces() {
|
||||||
|
let mut tmp = self.vx[[i, k]] * mx_b!(conc.f, i, k);
|
||||||
|
tmp += -dx_b!(conc.f, i, k);
|
||||||
|
self.qew[[i, k]] = tmp / H;
|
||||||
|
}
|
||||||
|
for (i, k) in grid.y_faces() {
|
||||||
|
let mut tmp = ((-self.vy[[i, k]]) + self.pe * H) * my_b!(conc.f, i, k);
|
||||||
|
tmp += -dy_b!(conc.f, i, k);
|
||||||
|
self.qsn[[i, k]] = tmp / H;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i, k) in grid.inner_nodes() {
|
||||||
|
let q = -(dx_f!(self.qew, i, k) + dy_f!(self.qsn, i, k));
|
||||||
|
conc.f[[i, k]] += dt / H * q;
|
||||||
|
}
|
||||||
|
for i in 1..NX - 1 {
|
||||||
|
let k = 0;
|
||||||
|
conc.f[[i, k]] += dt / H * (-dx_f!(self.qew, i, k) - 2.0 * self.qsn[[i, k + 1]]);
|
||||||
|
|
||||||
|
let k = NY - 1;
|
||||||
|
conc.f[[i, k]] += dt / H * (-dx_f!(self.qew, i, k) + 2.0 * self.qsn[[i, k]]);
|
||||||
|
}
|
||||||
|
if PEREODIC {
|
||||||
|
for k in 0..NY {
|
||||||
|
conc.f[[0, k]] = conc.f[[NX - 2, k]];
|
||||||
|
conc.f[[NX - 1, k]] = conc.f[[1, k]];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for k in 1..NY - 1 {
|
||||||
|
let i = 0;
|
||||||
|
conc.f[[i, k]] += dt / H * (-dy_f!(self.qsn, i, k) - 2.0 * self.qew[[i + 1, k]]);
|
||||||
|
|
||||||
|
let i = NX - 1;
|
||||||
|
conc.f[[i, k]] += dt / H * (-dy_f!(self.qsn, i, k) + 2.0 * self.qew[[i, k]]);
|
||||||
|
}
|
||||||
|
conc.f[[0, 0]] += dt / H * 2.0 * (-self.qew[[1, 0]] - self.qsn[[0, 1]]);
|
||||||
|
conc.f[[0, NY - 1]] += dt / H * 2.0 * (-self.qew[[1, NY - 1]] + self.qsn[[0, NY - 1]]);
|
||||||
|
conc.f[[NX - 1, 0]] += dt / H * 2.0 * (self.qew[[NX - 1, 0]] - self.qsn[[NX - 1, 1]]);
|
||||||
|
conc.f[[NX - 1, NY - 1]] +=
|
||||||
|
dt / H * 2.0 * (self.qew[[NX - 1, NY - 1]] + self.qsn[[NX - 1, NY - 1]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn calc_v(&mut self, psi: &Field2D) {
|
||||||
|
for i in 1..NX {
|
||||||
|
let mut k = 0;
|
||||||
|
self.vx[[i, k]] = 0.5 * (psi.f[[i, k + 1]] + psi.f[[i - 1, k + 1]]);
|
||||||
|
|
||||||
|
for k in 1..NY - 1 {
|
||||||
|
self.vx[[i, k]] = 0.5 * (dy!(psi.f, i, k) + dy!(psi.f, i - 1, k));
|
||||||
|
}
|
||||||
|
k = NY - 1;
|
||||||
|
self.vx[[i, k]] = -0.5 * (psi.f[[i, k - 1]] + psi.f[[i - 1, k - 1]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for i in 1..NX - 1 {
|
||||||
|
for k in 1..NY {
|
||||||
|
self.vy[[i, k]] = 0.5 * (dx!(psi.f, i, k) + dx!(psi.f, i, k - 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for k in 1..NY {
|
||||||
|
let i = 0;
|
||||||
|
self.vy[[i, k]] = 0.5 * (psi.f[[i + 1, k]] + psi.f[[i + 1, k - 1]]);
|
||||||
|
|
||||||
|
let i = NX - 1;
|
||||||
|
self.vy[[i, k]] = -0.5 * (psi.f[[i - 1, k]] + psi.f[[i - 1, k - 1]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+176
@@ -0,0 +1,176 @@
|
|||||||
|
const NY: usize = 31;
|
||||||
|
const L: f64 = 2.0;
|
||||||
|
const HEIGHT: f64 = 1.0;
|
||||||
|
const H: f64 = HEIGHT / ((NY - 1) as f64);
|
||||||
|
const NX: usize = ((L / H).round() as usize) + 1;
|
||||||
|
//
|
||||||
|
//const NX:usize=4;
|
||||||
|
//const H:f64=HEIGHT/((NY-1) as f64);
|
||||||
|
const PEREODIC: bool = true;
|
||||||
|
|
||||||
|
use ndarray_stats::QuantileExt;
|
||||||
|
pub mod equations;
|
||||||
|
use csv::Writer;
|
||||||
|
use equations::{Params, PhiEquation, TemperatureEquation};
|
||||||
|
use pdifflib::finit_diff::poisson_relax;
|
||||||
|
use serde::Serialize;
|
||||||
|
use std::fs;
|
||||||
|
|
||||||
|
use pdifflib::field::Field2D;
|
||||||
|
use pdifflib::system::System;
|
||||||
|
use toml;
|
||||||
|
|
||||||
|
struct S {
|
||||||
|
temp: Field2D,
|
||||||
|
psi: Field2D,
|
||||||
|
phi: Field2D,
|
||||||
|
conc: Field2D,
|
||||||
|
temp_eq: TemperatureEquation,
|
||||||
|
phi_eq: PhiEquation,
|
||||||
|
params: Params,
|
||||||
|
time: f64,
|
||||||
|
// file:hdf5::File,
|
||||||
|
}
|
||||||
|
impl System for S {
|
||||||
|
fn next_step(&mut self, dt: f64, time: f64) {
|
||||||
|
self.time = time;
|
||||||
|
self.phi_eq
|
||||||
|
.step(&mut self.phi.f, &self.psi.f, &self.temp.f, dt);
|
||||||
|
poisson_relax(&self.phi.f, &mut self.psi.f, H, PEREODIC);
|
||||||
|
self.temp_eq.step(&mut self.temp.f, &self.psi.f, dt);
|
||||||
|
// self.conc_eq
|
||||||
|
// .step(&mut self.conc, &self.psi, &self.temp, _dt);
|
||||||
|
self.boundary_condition();
|
||||||
|
}
|
||||||
|
fn fields(&self) -> Vec<&Field2D> {
|
||||||
|
vec![&self.phi, &self.psi, &self.temp, &self.conc]
|
||||||
|
}
|
||||||
|
|
||||||
|
fn fields_mut(&mut self) -> Vec<&mut Field2D> {
|
||||||
|
vec![&mut self.phi, &mut self.psi, &mut self.temp, &mut self.conc]
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_h(&self) -> f64 {
|
||||||
|
H
|
||||||
|
}
|
||||||
|
|
||||||
|
fn boundary_condition(&mut self) {
|
||||||
|
if PEREODIC {
|
||||||
|
for i in 0..NY {
|
||||||
|
self.phi.f[[0, i]] = self.phi.f[[NX - 2, i]];
|
||||||
|
self.phi.f[[NX - 1, i]] = self.phi.f[[1, i]];
|
||||||
|
|
||||||
|
self.temp.f[[0, i]] = self.temp.f[[NX - 2, i]];
|
||||||
|
self.temp.f[[NX - 1, i]] = self.temp.f[[1, i]];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for i in 1..NY - 1 {
|
||||||
|
self.phi.f[[0, i]] = -self.psi.f[[1, i]] / (H * H) * 2.0;
|
||||||
|
self.phi.f[[NX - 1, i]] = -self.psi.f[[NX - 2, i]] / (H * H) * 2.0;
|
||||||
|
//self.phi.f[[NX - 1, i]] = -self.params.le
|
||||||
|
// * self.params.ma
|
||||||
|
// * (self.conc.f[[NX - 1, i + 1]] - self.conc.f[[NX - 1, i - 1]])
|
||||||
|
// / (H * 2.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for i in 0..NX {
|
||||||
|
self.phi.f[[i, 0]] = -self.psi.f[[i, 1]] / (H * H) * 2.0;
|
||||||
|
self.phi.f[[i, NY - 1]] = -self.psi.f[[i, NY - 2]] / (H * H) * 2.0;
|
||||||
|
|
||||||
|
self.temp.f[[i, 0]] = 1.0;
|
||||||
|
|
||||||
|
self.temp.f[[i, NY - 1]] = 0.0;
|
||||||
|
}
|
||||||
|
//for i in 1..NX - 1 {
|
||||||
|
// self.phi.f[[i, NY - 1]] = -self.params.le
|
||||||
|
// * self.params.ma
|
||||||
|
// * (self.conc.f[[i + 1, NY - 1]] - self.conc.f[[i - 1, NY - 1]])
|
||||||
|
// / (H * 2.0);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
fn log_params(&self, wrt: &mut Writer<fs::File>, time: f64) {
|
||||||
|
let mut nu = 0.0;
|
||||||
|
let shape = self.temp.f.dim();
|
||||||
|
for i in 1..shape.0 - 1 {
|
||||||
|
nu += self.temp.f[[i, shape.1 - 1]] - self.temp.f[[i, shape.1 - 2]]
|
||||||
|
}
|
||||||
|
nu /= H * (shape.0 as f64) - 2.0;
|
||||||
|
|
||||||
|
let row = Row {
|
||||||
|
t: time,
|
||||||
|
psi_m: *(self.psi.f.max().unwrap()),
|
||||||
|
psi_l: (self.psi.f[[NX / 4, NY / 2]]),
|
||||||
|
nu: nu,
|
||||||
|
};
|
||||||
|
wrt.serialize(&row).unwrap();
|
||||||
|
}
|
||||||
|
fn get_max_time(&self) -> f64 {
|
||||||
|
return self.params.time;
|
||||||
|
}
|
||||||
|
fn get_DT(&self) -> f64 {
|
||||||
|
return H * H / 5.0 / 60.;
|
||||||
|
}
|
||||||
|
fn initial_condition(&mut self) {
|
||||||
|
let pe = self.params.pe;
|
||||||
|
let amp = 1e-6;
|
||||||
|
for i in 0..NX {
|
||||||
|
for j in 0..NY {
|
||||||
|
let x = (i as f64) * H;
|
||||||
|
let z = (j as f64) * H;
|
||||||
|
let pi = std::f64::consts::PI;
|
||||||
|
self.temp.f[[i, j]] = 1.0 - z + amp * (2.0 * pi * x / L).sin() * (pi * z).sin();
|
||||||
|
self.phi.f[[i, j]] = 0.0;
|
||||||
|
self.psi.f[[i, j]] = 0.0;
|
||||||
|
if pe.abs() > 1e-5 {
|
||||||
|
//self.conc.f[[i, j]] = -f64::exp(z * pe) / (1.0 - f64::exp(pe));
|
||||||
|
self.conc.f[[i, j]] = 1.0 / pe.abs()
|
||||||
|
} else {
|
||||||
|
self.conc.f[[i, j]] = 0.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize)]
|
||||||
|
pub struct Row {
|
||||||
|
t: f64,
|
||||||
|
psi_m: f64,
|
||||||
|
psi_l: f64,
|
||||||
|
nu: f64,
|
||||||
|
}
|
||||||
|
fn read_params() -> Params {
|
||||||
|
let contents = fs::read_to_string("config.toml").unwrap();
|
||||||
|
let params: Params = toml::from_str(&contents).unwrap();
|
||||||
|
params
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
println!(
|
||||||
|
"init,{:?},{:?},{:?},{:?},{:?}",
|
||||||
|
H,
|
||||||
|
NX,
|
||||||
|
NY,
|
||||||
|
L,
|
||||||
|
(1.0 / (NY - 1) as f64)
|
||||||
|
);
|
||||||
|
//let mut dela =Array2::<f64>::zeros((NX,NY));
|
||||||
|
let params = read_params();
|
||||||
|
println!("{:?}", params);
|
||||||
|
|
||||||
|
let mut system = S {
|
||||||
|
temp: Field2D::new("T", NX, NY),
|
||||||
|
phi: Field2D::new("phi", NX, NY),
|
||||||
|
psi: Field2D::new("psi", NX, NY),
|
||||||
|
conc: Field2D::new("C", NX, NY),
|
||||||
|
temp_eq: TemperatureEquation::new(NX, NY),
|
||||||
|
phi_eq: PhiEquation::new(NX, NY, params.rel, params.pr),
|
||||||
|
params,
|
||||||
|
time: 0.0,
|
||||||
|
// file:file
|
||||||
|
};
|
||||||
|
println!("start solve");
|
||||||
|
system.solve(true);
|
||||||
|
system.write_last()
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user