diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff209d2..12989ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,71 +1,71 @@ -name: CI -on: - - push - - pull_request - -jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - version: - - '1.6' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'. - - '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia. - - 'nightly' - os: - - ubuntu-latest - - macOS-latest - - windows-latest - arch: - - x64 - - x86 - exclude: - - os: macOS-latest - arch: x86 - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 - with: - file: lcov.info - docs: - name: Documentation - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 - with: - version: '1' - - run: | - julia --project=docs -e ' - using Pkg - Pkg.develop(PackageSpec(path=pwd())) - Pkg.instantiate()' - - run: | - julia --project=docs -e ' - using Documenter: doctest - using Swalbe - doctest(Swalbe)' - - name: Build and deploy - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - run: julia --project=docs/ docs/make.jl +name: CI +on: + - push + - pull_request + +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.6' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'. + - '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia. + - 'nightly' + os: + - ubuntu-latest + - macOS-latest + - windows-latest + arch: + - x64 + - x86 + exclude: + - os: macOS-latest + arch: x86 + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: actions/cache@v1 + env: + cache-name: cache-artifacts + with: + path: ~/.julia/artifacts + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + restore-keys: | + ${{ runner.os }}-test-${{ env.cache-name }}- + ${{ runner.os }}-test- + ${{ runner.os }}- + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info + docs: + name: Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: '1' + - run: | + julia --project=docs -e ' + using Pkg + Pkg.develop(PackageSpec(path=pwd())) + Pkg.instantiate()' + - run: | + julia --project=docs -e ' + using Documenter: doctest + using Swalbe + doctest(Swalbe)' + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + run: julia --project=docs/ docs/make.jl diff --git a/.gitignore b/.gitignore index b2b91f1..5f38545 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,13 @@ +# Coverage and other things *.jl.*.cov *.jl.cov *.jl.mem + +# Documentation /docs/build/ +/docs/Manifest.toml + +# Pictures, data and tools /images/* /data/* /figures/* diff --git a/Project.toml b/Project.toml index 2ee479a..749939a 100644 --- a/Project.toml +++ b/Project.toml @@ -5,6 +5,7 @@ version = "1.0.3" [deps] BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" +CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" diff --git a/docs/Manifest.toml b/docs/Manifest.toml deleted file mode 100644 index ae5b4ab..0000000 --- a/docs/Manifest.toml +++ /dev/null @@ -1,660 +0,0 @@ -# This file is machine-generated - editing it directly is not advised - -julia_version = "1.7.2" -manifest_format = "2.0" - -[[deps.AbstractFFTs]] -deps = ["ChainRulesCore", "LinearAlgebra"] -git-tree-sha1 = "6f1d9bc1c08f9f4a8fa92e3ea3cb50153a1b40d4" -uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" -version = "1.1.0" - -[[deps.Adapt]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "af92965fb30777147966f58acb05da51c5616b5f" -uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" -version = "3.3.3" - -[[deps.ArgTools]] -uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" - -[[deps.Artifacts]] -uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" - -[[deps.BFloat16s]] -deps = ["LinearAlgebra", "Printf", "Random", "Test"] -git-tree-sha1 = "a598ecb0d717092b5539dbbe890c98bac842b072" -uuid = "ab4f0b2a-ad5b-11e8-123f-65d77653426b" -version = "0.2.0" - -[[deps.BSON]] -git-tree-sha1 = "306bb5574b0c1c56d7e1207581516c557d105cad" -uuid = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" -version = "0.3.5" - -[[deps.Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[deps.BenchmarkTools]] -deps = ["JSON", "Logging", "Printf", "Profile", "Statistics", "UUIDs"] -git-tree-sha1 = "4c10eee4af024676200bc7752e536f858c6b8f93" -uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" -version = "1.3.1" - -[[deps.BinaryProvider]] -deps = ["Libdl", "Logging", "SHA"] -git-tree-sha1 = "ecdec412a9abc8db54c0efc5548c64dfce072058" -uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232" -version = "0.5.10" - -[[deps.Bzip2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "19a35467a82e236ff51bc17a3a44b69ef35185a2" -uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" -version = "1.0.8+0" - -[[deps.CEnum]] -git-tree-sha1 = "215a9aa4a1f23fbd05b92769fdd62559488d70e9" -uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" -version = "0.4.1" - -[[deps.CRlibm]] -deps = ["CRlibm_jll"] -git-tree-sha1 = "32abd86e3c2025db5172aa182b982debed519834" -uuid = "96374032-68de-5a5b-8d9e-752f78720389" -version = "1.0.1" - -[[deps.CRlibm_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "e329286945d0cfc04456972ea732551869af1cfc" -uuid = "4e9b3aee-d8a1-5a3d-ad8b-7d824db253f0" -version = "1.0.1+0" - -[[deps.CUDA]] -deps = ["AbstractFFTs", "Adapt", "BFloat16s", "CEnum", "CompilerSupportLibraries_jll", "ExprTools", "GPUArrays", "GPUCompiler", "LLVM", "LazyArtifacts", "Libdl", "LinearAlgebra", "Logging", "Printf", "Random", "Random123", "RandomNumbers", "Reexport", "Requires", "SparseArrays", "SpecialFunctions", "TimerOutputs"] -git-tree-sha1 = "7405a853ebba81936827459bfe30608bbce7371e" -uuid = "052768ef-5323-5732-b1bb-66c8b64840ba" -version = "3.8.0" - -[[deps.Calculus]] -deps = ["LinearAlgebra"] -git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad" -uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9" -version = "0.5.1" - -[[deps.ChainRulesCore]] -deps = ["Compat", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "f9982ef575e19b0e5c7a98c6e75ee496c0f73a93" -uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "1.12.0" - -[[deps.ChangesOfVariables]] -deps = ["ChainRulesCore", "LinearAlgebra", "Test"] -git-tree-sha1 = "bf98fa45a0a4cee295de98d4c1462be26345b9a1" -uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" -version = "0.1.2" - -[[deps.CodeTracking]] -deps = ["InteractiveUtils", "UUIDs"] -git-tree-sha1 = "9aa8a5ebb6b5bf469a7e0e2b5202cf6f8c291104" -uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" -version = "1.0.6" - -[[deps.CodecBzip2]] -deps = ["Bzip2_jll", "Libdl", "TranscodingStreams"] -git-tree-sha1 = "2e62a725210ce3c3c2e1a3080190e7ca491f18d7" -uuid = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd" -version = "0.7.2" - -[[deps.CodecZlib]] -deps = ["TranscodingStreams", "Zlib_jll"] -git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da" -uuid = "944b1d66-785c-5afd-91f1-9de20f533193" -version = "0.7.0" - -[[deps.CommonSubexpressions]] -deps = ["MacroTools", "Test"] -git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" -uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" -version = "0.3.0" - -[[deps.Compat]] -deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] -git-tree-sha1 = "44c37b4636bc54afac5c574d2d02b625349d6582" -uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "3.41.0" - -[[deps.CompilerSupportLibraries_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" - -[[deps.Crayons]] -git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15" -uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" -version = "4.1.1" - -[[deps.DataAPI]] -git-tree-sha1 = "cc70b17275652eb47bc9e5f81635981f13cea5c8" -uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" -version = "1.9.0" - -[[deps.DataFrames]] -deps = ["Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] -git-tree-sha1 = "ae02104e835f219b8930c7664b8012c93475c340" -uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" -version = "1.3.2" - -[[deps.DataStructures]] -deps = ["Compat", "InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "3daef5523dd2e769dad2365274f760ff5f282c7d" -uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.11" - -[[deps.DataValueInterfaces]] -git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" -uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" -version = "1.0.0" - -[[deps.Dates]] -deps = ["Printf"] -uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" - -[[deps.DelimitedFiles]] -deps = ["Mmap"] -uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" - -[[deps.DiffResults]] -deps = ["StaticArrays"] -git-tree-sha1 = "c18e98cba888c6c25d1c3b048e4b3380ca956805" -uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" -version = "1.0.3" - -[[deps.DiffRules]] -deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] -git-tree-sha1 = "84083a5136b6abf426174a58325ffd159dd6d94f" -uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" -version = "1.9.1" - -[[deps.Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[deps.DocStringExtensions]] -deps = ["LibGit2"] -git-tree-sha1 = "b19534d1895d702889b219c382a6e18010797f0b" -uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.8.6" - -[[deps.Documenter]] -deps = ["Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] -git-tree-sha1 = "b7715ae18be02110a8cf9cc8ed2ccdb1e3e3aba2" -uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -version = "0.26.1" - -[[deps.Downloads]] -deps = ["ArgTools", "LibCURL", "NetworkOptions"] -uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" - -[[deps.ErrorfreeArithmetic]] -git-tree-sha1 = "d6863c556f1142a061532e79f611aa46be201686" -uuid = "90fa49ef-747e-5e6f-a989-263ba693cf1a" -version = "0.5.2" - -[[deps.ExprTools]] -git-tree-sha1 = "56559bbef6ca5ea0c0818fa5c90320398a6fbf8d" -uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" -version = "0.1.8" - -[[deps.FastRounding]] -deps = ["ErrorfreeArithmetic", "Test"] -git-tree-sha1 = "224175e213fd4fe112db3eea05d66b308dc2bf6b" -uuid = "fa42c844-2597-5d31-933b-ebd51ab2693f" -version = "0.2.0" - -[[deps.FileIO]] -deps = ["Pkg", "Requires", "UUIDs"] -git-tree-sha1 = "80ced645013a5dbdc52cf70329399c35ce007fae" -uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" -version = "1.13.0" - -[[deps.FileWatching]] -uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" - -[[deps.Formatting]] -deps = ["Printf"] -git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8" -uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" -version = "0.4.2" - -[[deps.ForwardDiff]] -deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions", "StaticArrays"] -git-tree-sha1 = "1bd6fc0c344fc0cbee1f42f8d2e7ec8253dda2d2" -uuid = "f6369f11-7733-5829-9624-2563aa707210" -version = "0.10.25" - -[[deps.Future]] -deps = ["Random"] -uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" - -[[deps.GLPK]] -deps = ["BinaryProvider", "CEnum", "GLPK_jll", "Libdl", "MathOptInterface"] -git-tree-sha1 = "6f4e9754ee93e2b2ff40c0b0a6b4cdffd289190d" -uuid = "60bf3e95-4087-53dc-ae20-288a0d20c6a6" -version = "0.15.3" - -[[deps.GLPK_jll]] -deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "fe68622f32828aa92275895fdb324a85894a5b1b" -uuid = "e8aa6df9-e6ca-548a-97ff-1f85fc5b8b98" -version = "5.0.1+0" - -[[deps.GMP_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "781609d7-10c4-51f6-84f2-b8444358ff6d" - -[[deps.GPUArrays]] -deps = ["Adapt", "LLVM", "LinearAlgebra", "Printf", "Random", "Serialization", "Statistics"] -git-tree-sha1 = "cf91e6e9213b9190dc0511d6fff862a86652a94a" -uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7" -version = "8.2.1" - -[[deps.GPUCompiler]] -deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "TimerOutputs", "UUIDs"] -git-tree-sha1 = "abd824e1f2ecd18d33811629c781441e94a24e81" -uuid = "61eb1bfa-7361-4325-ad38-22787b887f55" -version = "0.13.11" - -[[deps.IOCapture]] -deps = ["Logging"] -git-tree-sha1 = "377252859f740c217b936cebcd918a44f9b53b59" -uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89" -version = "0.1.1" - -[[deps.InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" - -[[deps.IntervalArithmetic]] -deps = ["CRlibm", "FastRounding", "LinearAlgebra", "Markdown", "Random", "RecipesBase", "RoundingEmulator", "SetRounding", "StaticArrays"] -git-tree-sha1 = "bbf2793a70c0a7aaa09aa298b277fe1b90e06d78" -uuid = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253" -version = "0.20.3" - -[[deps.InverseFunctions]] -deps = ["Test"] -git-tree-sha1 = "a7254c0acd8e62f1ac75ad24d5db43f5f19f3c65" -uuid = "3587e190-3f89-42d0-90ee-14403ec27112" -version = "0.1.2" - -[[deps.InvertedIndices]] -git-tree-sha1 = "bee5f1ef5bf65df56bdd2e40447590b272a5471f" -uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f" -version = "1.1.0" - -[[deps.IrrationalConstants]] -git-tree-sha1 = "7fd44fd4ff43fc60815f8e764c0f352b83c49151" -uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" -version = "0.1.1" - -[[deps.IteratorInterfaceExtensions]] -git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" -uuid = "82899510-4779-5014-852e-03e436cf321d" -version = "1.0.0" - -[[deps.JLD2]] -deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "Pkg", "Printf", "Reexport", "TranscodingStreams", "UUIDs"] -git-tree-sha1 = "28b114b3279cdbac9a61c57b3e6548a572142b34" -uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819" -version = "0.4.21" - -[[deps.JLLWrappers]] -deps = ["Preferences"] -git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1" -uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.4.1" - -[[deps.JSON]] -deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e" -uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.3" - -[[deps.JuMP]] -deps = ["Calculus", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MathOptInterface", "MutableArithmetics", "NaNMath", "OrderedCollections", "Printf", "Random", "SparseArrays", "SpecialFunctions", "Statistics"] -git-tree-sha1 = "fe0f87cc077fc6a23c21e469318993caf2947d10" -uuid = "4076af6c-e467-56ae-b986-b466b2749572" -version = "0.22.3" - -[[deps.JuliaInterpreter]] -deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"] -git-tree-sha1 = "b55aae9a2bf436fc797d9c253a900913e0e90178" -uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a" -version = "0.9.3" - -[[deps.LLVM]] -deps = ["CEnum", "LLVMExtra_jll", "Libdl", "Printf", "Unicode"] -git-tree-sha1 = "f8dcd7adfda0dddaf944e62476d823164cccc217" -uuid = "929cbde3-209d-540e-8aea-75f648917ca0" -version = "4.7.1" - -[[deps.LLVMExtra_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "f7f5dd0fb39209f4d28ca59d0d4e24579ad325fe" -uuid = "dad2f222-ce93-54a1-a47d-0025e8a3acab" -version = "0.0.13+2" - -[[deps.LazyArtifacts]] -deps = ["Artifacts", "Pkg"] -uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" - -[[deps.LazySets]] -deps = ["Distributed", "ExprTools", "GLPK", "InteractiveUtils", "IntervalArithmetic", "JuMP", "LinearAlgebra", "Random", "RecipesBase", "Reexport", "Requires", "SharedArrays", "SparseArrays"] -git-tree-sha1 = "e92e22dcd8abf31f9418213936aa41399740dd94" -uuid = "b4f0291d-fe17-52bc-9479-3d1a343d9043" -version = "1.55.0" - -[[deps.LibCURL]] -deps = ["LibCURL_jll", "MozillaCACerts_jll"] -uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" - -[[deps.LibCURL_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] -uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" - -[[deps.LibGit2]] -deps = ["Base64", "NetworkOptions", "Printf", "SHA"] -uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" - -[[deps.LibSSH2_jll]] -deps = ["Artifacts", "Libdl", "MbedTLS_jll"] -uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" - -[[deps.Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[deps.LinearAlgebra]] -deps = ["Libdl", "libblastrampoline_jll"] -uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" - -[[deps.LogExpFunctions]] -deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "e5718a00af0ab9756305a0392832c8952c7426c1" -uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.6" - -[[deps.Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[deps.LoweredCodeUtils]] -deps = ["JuliaInterpreter"] -git-tree-sha1 = "6b0440822974cab904c8b14d79743565140567f6" -uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b" -version = "2.2.1" - -[[deps.MacroTools]] -deps = ["Markdown", "Random"] -git-tree-sha1 = "3d3e902b31198a27340d0bf00d6ac452866021cf" -uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.9" - -[[deps.Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - -[[deps.MathOptInterface]] -deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "JSON", "LinearAlgebra", "MutableArithmetics", "OrderedCollections", "Printf", "SparseArrays", "Test", "Unicode"] -git-tree-sha1 = "625f78c57a263e943f525d3860f30e4d200124ab" -uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" -version = "0.10.8" - -[[deps.MbedTLS_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" - -[[deps.Missings]] -deps = ["DataAPI"] -git-tree-sha1 = "bf210ce90b6c9eed32d25dbcae1ebc565df2687f" -uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" -version = "1.0.2" - -[[deps.Mmap]] -uuid = "a63ad114-7e13-5084-954f-fe012c677804" - -[[deps.MozillaCACerts_jll]] -uuid = "14a3606d-f60d-562e-9121-12d972cd8159" - -[[deps.MutableArithmetics]] -deps = ["LinearAlgebra", "SparseArrays", "Test"] -git-tree-sha1 = "842b5ccd156e432f369b204bb704fd4020e383ac" -uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" -version = "0.3.3" - -[[deps.NaNMath]] -git-tree-sha1 = "b086b7ea07f8e38cf122f5016af580881ac914fe" -uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" -version = "0.3.7" - -[[deps.NetworkOptions]] -uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" - -[[deps.OpenBLAS_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] -uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" - -[[deps.OpenLibm_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "05823500-19ac-5b8b-9628-191a04bc5112" - -[[deps.OpenSpecFun_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" -uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" -version = "0.5.5+0" - -[[deps.OrderedCollections]] -git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c" -uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.4.1" - -[[deps.Parameters]] -deps = ["OrderedCollections", "UnPack"] -git-tree-sha1 = "34c0e9ad262e5f7fc75b10a9952ca7692cfc5fbe" -uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a" -version = "0.12.3" - -[[deps.Parsers]] -deps = ["Dates"] -git-tree-sha1 = "13468f237353112a01b2d6b32f3d0f80219944aa" -uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.2.2" - -[[deps.Pkg]] -deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] -uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" - -[[deps.PooledArrays]] -deps = ["DataAPI", "Future"] -git-tree-sha1 = "db3a23166af8aebf4db5ef87ac5b00d36eb771e2" -uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" -version = "1.4.0" - -[[deps.Preferences]] -deps = ["TOML"] -git-tree-sha1 = "2cf929d64681236a2e074ffafb8d568733d2e6af" -uuid = "21216c6a-2e73-6563-6e65-726566657250" -version = "1.2.3" - -[[deps.PrettyTables]] -deps = ["Crayons", "Formatting", "Markdown", "Reexport", "Tables"] -git-tree-sha1 = "dfb54c4e414caa595a1f2ed759b160f5a3ddcba5" -uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" -version = "1.3.1" - -[[deps.Printf]] -deps = ["Unicode"] -uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" - -[[deps.Profile]] -deps = ["Printf"] -uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" - -[[deps.REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] -uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" - -[[deps.Random]] -deps = ["SHA", "Serialization"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[deps.Random123]] -deps = ["Libdl", "Random", "RandomNumbers"] -git-tree-sha1 = "0e8b146557ad1c6deb1367655e052276690e71a3" -uuid = "74087812-796a-5b5d-8853-05524746bad3" -version = "1.4.2" - -[[deps.RandomNumbers]] -deps = ["Random", "Requires"] -git-tree-sha1 = "043da614cc7e95c703498a491e2c21f58a2b8111" -uuid = "e6cf234a-135c-5ec9-84dd-332b85af5143" -version = "1.5.3" - -[[deps.RecipesBase]] -git-tree-sha1 = "6bf3f380ff52ce0832ddd3a2a7b9538ed1bcca7d" -uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" -version = "1.2.1" - -[[deps.Reexport]] -git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" -uuid = "189a3867-3050-52da-a836-e630ba90ab69" -version = "1.2.2" - -[[deps.Requires]] -deps = ["UUIDs"] -git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" -uuid = "ae029012-a4dd-5104-9daa-d747884805df" -version = "1.3.0" - -[[deps.Revise]] -deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Pkg", "REPL", "Requires", "UUIDs", "Unicode"] -git-tree-sha1 = "2f9d4d6679b5f0394c52731db3794166f49d5131" -uuid = "295af30f-e4ad-537b-8983-00126c2a3abe" -version = "3.3.1" - -[[deps.RoundingEmulator]] -git-tree-sha1 = "40b9edad2e5287e05bd413a38f61a8ff55b9557b" -uuid = "5eaf0fd0-dfba-4ccb-bf02-d820a40db705" -version = "0.2.1" - -[[deps.SHA]] -uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" - -[[deps.Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[deps.SetRounding]] -git-tree-sha1 = "d7a25e439d07a17b7cdf97eecee504c50fedf5f6" -uuid = "3cc68bcd-71a2-5612-b932-767ffbe40ab0" -version = "0.2.1" - -[[deps.SharedArrays]] -deps = ["Distributed", "Mmap", "Random", "Serialization"] -uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" - -[[deps.Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[deps.SortingAlgorithms]] -deps = ["DataStructures"] -git-tree-sha1 = "b3363d7460f7d098ca0912c69b082f75625d7508" -uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" -version = "1.0.1" - -[[deps.SparseArrays]] -deps = ["LinearAlgebra", "Random"] -uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" - -[[deps.SpecialFunctions]] -deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "8d0c8e3d0ff211d9ff4a0c2307d876c99d10bdf1" -uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.1.2" - -[[deps.StaticArrays]] -deps = ["LinearAlgebra", "Random", "Statistics"] -git-tree-sha1 = "95c6a5d0e8c69555842fc4a927fc485040ccc31c" -uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.3.5" - -[[deps.Statistics]] -deps = ["LinearAlgebra", "SparseArrays"] -uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" - -[[deps.Swalbe]] -deps = ["BSON", "CUDA", "DataFrames", "FileIO", "JLD2", "LazySets", "Parameters", "Random", "Revise", "Statistics"] -path = "C:\\Users\\zitz\\Software_Projects\\Swalbe.jl" -uuid = "1073fb09-a5e2-4e80-8bde-f3562efda53f" -version = "1.0.1" - -[[deps.TOML]] -deps = ["Dates"] -uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" - -[[deps.TableTraits]] -deps = ["IteratorInterfaceExtensions"] -git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" -uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" -version = "1.0.1" - -[[deps.Tables]] -deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"] -git-tree-sha1 = "bb1064c9a84c52e277f1096cf41434b675cd368b" -uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.6.1" - -[[deps.Tar]] -deps = ["ArgTools", "SHA"] -uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" - -[[deps.Test]] -deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] -uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[[deps.TimerOutputs]] -deps = ["ExprTools", "Printf"] -git-tree-sha1 = "97e999be94a7147d0609d0b9fc9feca4bf24d76b" -uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" -version = "0.5.15" - -[[deps.TranscodingStreams]] -deps = ["Random", "Test"] -git-tree-sha1 = "216b95ea110b5972db65aa90f88d8d89dcb8851c" -uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.9.6" - -[[deps.UUIDs]] -deps = ["Random", "SHA"] -uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" - -[[deps.UnPack]] -git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" -uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" -version = "1.0.2" - -[[deps.Unicode]] -uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" - -[[deps.Zlib_jll]] -deps = ["Libdl"] -uuid = "83775a58-1f1d-513f-b197-d71354ab007a" - -[[deps.libblastrampoline_jll]] -deps = ["Artifacts", "Libdl", "OpenBLAS_jll"] -uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" - -[[deps.nghttp2_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" - -[[deps.p7zip_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" diff --git a/docs/src/functions.md b/docs/src/functions.md index 0646454..abf8b27 100644 --- a/docs/src/functions.md +++ b/docs/src/functions.md @@ -11,4 +11,4 @@ Pages = ["equilibrium.jl", "collide.jl", "moments.jl", "forcing.jl", "pressure.j ``` ```@index -``` \ No newline at end of file +``` diff --git a/scripts/Droplets.jl b/scripts/Droplets.jl deleted file mode 100644 index dc03d6e..0000000 --- a/scripts/Droplets.jl +++ /dev/null @@ -1,130 +0,0 @@ -using Swalbe, Plots - -""" - run_drop_coal() - -Simulation of two droplets in close contact to study their coalesence behaviour. -""" -function run_drop_coal( - sys::Swalbe.SysConst_1D; # System relevant constants - r₁=500, # First droplets radius - r₂=500, # Second droplets radius - θ₀=1/9, # Contact angle - centers=(sys.L/3, 2*sys.L/3), # Drople centers - dump = 100, # Data dumping interval - fluid=zeros(sys.Tmax÷dump, sys.L), # Data - verbos=true # Simulation updates about the bridge height in consol -) - println("Simulating droplet coalecense") - state = Swalbe.Sys(sys) - state.height .= Swalbe.two_droplets(sys, r₁=r₁, r₂=r₂, θ₁=θ₀, θ₂=θ₀, center=centers) - Swalbe.equilibrium!(state) - println("Starting the lattice Boltzmann time loop") - for t in 1:sys.Tmax - if t % sys.tdump == 0 - mass = 0.0 - mass = sum(state.height) - if verbos - println("Time step $t bridge height is $(round(state.height[Int(sys.L/2)], digits=3))") - end - end - Swalbe.filmpressure!(state, sys) - Swalbe.h∇p!(state) - Swalbe.slippage!(state, sys) - state.F .= -state.h∇p .- state.slip - Swalbe.equilibrium!(state) - Swalbe.BGKandStream!(state) - Swalbe.moments!(state) - # Make a snaphot of the configuration - Swalbe.snapshot!(fluid, state.height, t, dumping = dump) - end - return fluid -end - -""" - bridge_height(data) - -Compuation of the bridge height between two droplets based on input `data`. -""" -function bridge_height(data; t1=100, t_dur=size(data)[1], pos=size(data)[2]÷2) - bridge_h = [] - for i in 1:t_dur - push!(bridge_h, data[i, pos]) - end - return bridge_h -end - -""" - τν(γ, R, η) - -Computes the viscous time. - -# Mathematics - -``t_c = \\sqrt{\\frac{\\rho R^3}{\\gamma}}`` -""" -function τν(γ; R=500, η=1/6) - time_c = 0.0 - time_c = R*η/γ - return time_c -end - -# Different surface tension values -γs = [0.00001, 0.00005, 0.0001, 0.0005] -# Large array that contains the simulation data -data_merge = zeros(20000, 1024, length(γs)) -# Drop radii -sphere_rad = 500.0 -# Loop different surface tension values -for γ in enumerate(γs) - sys = Swalbe.SysConst_1D(L=1024, Tmax=2000000, δ=50.0, γ=γ[2]) - data_merge[:,:,γ[1]] = run_drop_coal(sys, r₁=sphere_rad, r₂=sphere_rad) -end -# Compute the bridge heights for the data collect and store it in a single array -bridges = zeros(20000, length(γs)) -for i in 1:length(γs) - bridges[:, i] = bridge_height(data_merge[:,:,i]) -end -# Actual LBM time, time steps without (physical) meaning -time_lbm = 100:100:2000000 -p1 = plot(time_lbm, # x-data - bridges, # y-data - xlabel="t [Δt]", # axis label - ylabel="h₀", # axis label - label=["γ=0.00001" "γ=0.00005" "γ=0.0001" "γ=0.0005"], # labels for the curves - xticks=([0:1000000:2000000;], ["0", "1×10⁶", "2×10⁶"]), # ticks and labels - xlims=(0,2100000), # well limits of display - ylims=(0, 40), # well limits of display - w = 3, # line width - marker = (8, :auto, 0.6), # marker size - legend=:bottomright, # legend position - legendfontsize = lf, # legend font size - tickfont = (14), # tick font and size - guidefont = (15), # label font and size - grid=:none # no gird, was asked once by PRE to remove the grid -) -# Now to collapse the curves we non-dimensionalize the time with the visous time scale τν and the height with the sphere radius R₀ -time_norm = zeros(length(time_lbm), length(γs)) -for i in enumerate(γs) - time_norm[:, i[1]] .= time_lbm ./ τν(i[2]) -end -# And plot it again -p2 = plot(time_norm, # x-data - bridges ./ 500.0, # y-data - xlabel="t [Δt]", # axis label - ylabel="h₀", # axis label - label=["γ=0.00001" "γ=0.00005" "γ=0.0001" "γ=0.0005"], # labels for the curves - xticks=([0:1000000:2000000;], ["0", "1×10⁶", "2×10⁶"]), # ticks and labels - xlims=(0,2100000), # well limits of display - ylims=(0, 40), # well limits of display - w = 3, # line width - marker = (8, :auto, 0.6), # marker size - legend=:bottomright, # legend position - legendfontsize = lf, # legend font size - tickfont = (14), # tick font and size - guidefont = (15), # label font and size - grid=:none # no gird, was asked once by PRE to remove the grid -) -# In the inertial regime we assume that the bridge height grows as time to the power of 2/3, we can check it by simply adding this curve -t_scaling = collect(1e-5:1e-5:10) # Finer time scale for the power law -plot!(t_scaling, 0.024 .* t_scaling.^(2/3), c=:black, w=4, l=:dash, label="t^(2/3)") diff --git a/scripts/Moving_wet_stab.jl b/scripts/Moving_wet_stab.jl new file mode 100644 index 0000000..9f0c8ac --- /dev/null +++ b/scripts/Moving_wet_stab.jl @@ -0,0 +1,138 @@ +using DrWatson +@quickactivate :Swalbe +using CUDA, DataFrames, FileIO +# CUDA.device!(1) + +# Fluid dynamics we need for the experiment +""" + measure_substratewave + +Simulates a changing wettability and the response from the film. +""" +function measure_substratewave( + sys::Swalbe.SysConst, + device::String; + h₀ = 1.0, + ϵ = 0.1, + wave_x=1, + wave_y=1, + sub_speed=100, + dump = 1000, + θₛ=ones(sys.Lx, sys.Ly), + fluid=zeros(sys.param.Tmax÷dump, sys.Lx*sys.Ly), + theta=zeros(sys.param.Tmax÷dump, sys.Lx*sys.Ly), + dire = "x", + verbos=true, + T=Float64 +) + state = Swalbe.Sys(sys, device) + if device == "CPU" + for i in 1:sys.Lx, j in 1:sys.Ly + state.height[i,j] = h₀ + ϵ * sin(2π*wave_x*(i-1)/sys.Lx) * sin(2π*wave_y*(j-1)/sys.Ly) + end + elseif device == "GPU" + h = zeros(size(state.height)) + for i in 1:sys.Lx, j in 1:sys.Ly + h[i,j] = h₀ + ϵ * sin(2π*wave_x*(i-1)/sys.Lx) * sin(2π*wave_y*(j-1)/sys.Ly) + end + # theta = CUDA.zeros(Float64, sys.Lx, sys.Ly) + state.height .= CUDA.adapt(CuArray, h) + end + Swalbe.equilibrium!(state, sys) + for t in 1:sys.param.Tmax + if t % sys.param.tdump == 0 + mass = 0.0 + mass = sum(state.height) + minh = minimum(state.height) + if minh < 0.05 + println("Rupture reached at $t") + break + end + if verbos + println("Time step $t mass is $(round(mass, digits=3))") + end + end + + Swalbe.filmpressure!(state, sys, θ=θₛ) + Swalbe.h∇p!(state) + Swalbe.slippage!(state, sys) + # Forces are the pressure gradient and the slippage due to substrate liquid boundary conditions + state.Fx .= -state.h∇px .- state.slipx + state.Fy .= -state.h∇py .- state.slipy + # New equilibrium + Swalbe.equilibrium!(state, sys) + Swalbe.BGKandStream!(state, sys) + # New moments + Swalbe.moments!(state) + # Measurements, in this case only snapshots of simulational arrays + Swalbe.snapshot!(fluid, state.height, t, dumping = dump) + Swalbe.snapshot!(theta, θₛ, t, dumping = dump) + move_substrate!(state.slipx, θₛ, t, sub_speed, direction=dire) + end + return fluid, theta + if device == "GPU" + CUDA.reclaim() + end +end + +function move_substrate!(θ, input, t, tmove; direction="diagonal") + # No substrate velocity no moving + if tmove == 0 + return + # Finite substrate velocity + else + if (t % tmove == 0) & (t > 0) + if direction == "diagonal" + circshift!(θ, input, (1,1)) + elseif direction == "x" + circshift!(θ, input, (1,0)) + elseif direction == "y" + circshift!(θ, input, (0,1)) + end + input .= θ + end + return nothing + end +end + +direction = "diagonal" +# Different initial volumes +waves_nums = 20 +theta_var = 1/18 +run_on = "GPU" +speed = 0# 980 +for waves_num in [20] # 4 5 6 7 8 9 10 + pattern = "sine" + ang = 1/9 + TM = 600000 # 5000000 + println("Simulating moving substrate wettability with pattern $(pattern) and moving direction $(direction) and speed $(speed)") + sys = Swalbe.SysConst(Lx=512, Ly=512, param=Swalbe.Taumucs(γ=0.01, δ=1.0, μ=1/12, n=3, m=2, hmin=0.07, Tmax=TM, tdump=1000)) + #sys = Swalbe.SysConst(Lx=512, Ly=512, γ=0.01, δ=1.0, n=3, m=2, hmin=0.07, Tmax=75000, tdump=500) + df_fluid = Dict() + df_sub = Dict() + θₚ = ones(sys.Lx,sys.Ly) + # Substrate patterning + if pattern == "sine" + for i in 1:sys.Lx, j in 1:sys.Ly + θₚ[i,j] = ang + theta_var * sin(2π*waves_num*(i-1)/sys.Lx) * sin(2π*waves_num*(j-1)/sys.Ly) + end + end + # Make a cuarray with the substrate pattern + θ_in = CUDA.adapt(CuArray, θₚ) + fluid, substrate = measure_substratewave(sys, run_on, sub_speed=speed, θₛ=θ_in, dire=direction, dump=sys.param.tdump) + + println("Writing measurements to Dict") + # Filling the dataframes + for t in 1:sys.param.Tmax÷sys.param.tdump + df_fluid["h_$(t*sys.param.tdump)"] = fluid[t,:] + df_sub["theta_$(t*sys.param.tdump)"] = substrate[t,:] + end + println("Saving Dict subdirection $direction subvel $speed and $(pattern) $waves_num to disk") + save_ang = Int(round(rad2deg(π*ang))) + save_ang_del = Int(round(rad2deg(π*theta_var))) + # save("data/Moving_wettability/height_direc_$(direction)_sp_$(speed)_$(pattern)_$(waves_num)_$(save_ang)_del_$(save_ang_del)_tmax_$(sys.param.Tmax)_v3.jld2", df_fluid) + + CUDA.reclaim() +end + +println("Script done, let's have a look at the data :)") \ No newline at end of file diff --git a/scripts/Moving_wettability.jl b/scripts/Moving_wettability.jl index acec117..8abafb7 100644 --- a/scripts/Moving_wettability.jl +++ b/scripts/Moving_wettability.jl @@ -219,6 +219,7 @@ v6 = [29404, 2940, 294] v7 = [34305, 3430, 343] v8 = [39206, 3920, 392] v9 = [44107, 4410, 441] +v10 = 2v5 # To pin down the Rayleigh-Plateu instability v_lam2_dia_more = [490, 245, 164, 123] for direction in ["diagonal"] # "diagonal" @@ -246,6 +247,8 @@ for direction in ["diagonal"] # "diagonal" speeds .= v8 elseif waves == 9 speeds .= v9 + elseif waves == 10 + speeds .= v10 end for speed in speeds # 1 2 3 # [0] pattern = "sine" diff --git a/scripts/Moving_wettability_structs.jl b/scripts/Moving_wettability_structs.jl new file mode 100644 index 0000000..b503781 --- /dev/null +++ b/scripts/Moving_wettability_structs.jl @@ -0,0 +1,237 @@ +using DrWatson +@quickactivate :Swalbe +using CUDA, DataFrames, FileIO +# CUDA.device!(1) + +# Fluid dynamics we need for the experiment +""" + measure_substratewave + +Simulates a changing wettability and the response from the film. +""" +function measure_substratewave( + sys::Swalbe.SysConst, + device::String; + h₀ = 1.0, + ϵ = 0.1, + wave_x=1, + wave_y=1, + sub_speed=100, + dump = 1000, + θₛ=ones(sys.Lx, sys.Ly), + fluid=zeros(sys.param.Tmax÷dump, sys.Lx*sys.Ly), + theta=zeros(sys.param.Tmax÷dump, sys.Lx*sys.Ly), + dire = "x", + verbos=true, + T=Float64 +) + state = Swalbe.Sys(sys, device) + if device == "CPU" + for i in 1:sys.Lx, j in 1:sys.Ly + state.height[i,j] = h₀ + ϵ * sin(2π*wave_x*(i-1)/sys.Lx) * sin(2π*wave_y*(j-1)/sys.Ly) + end + elseif device == "GPU" + h = zeros(size(state.height)) + for i in 1:sys.Lx, j in 1:sys.Ly + h[i,j] = h₀ + ϵ * sin(2π*wave_x*(i-1)/sys.Lx) * sin(2π*wave_y*(j-1)/sys.Ly) + end + # theta = CUDA.zeros(Float64, sys.Lx, sys.Ly) + state.height .= CUDA.adapt(CuArray, h) + end + Swalbe.equilibrium!(state, sys) + for t in 1:sys.param.Tmax + if t % sys.param.tdump == 0 + mass = 0.0 + mass = sum(state.height) + if isnan(mass) + println("Stresses diverged for $(sys.param.δ)") + break + end + if verbos + println("Time step $t mass is $(round(mass, digits=3))") + println("Minimal thickness $(round(minimum(state.height), digits=3))") + end + end + + Swalbe.filmpressure!(state, sys, θ=θₛ) + Swalbe.h∇p!(state) + Swalbe.slippage!(state, sys) + # Forces are the pressure gradient and the slippage due to substrate liquid boundary conditions + state.Fx .= -state.h∇px .- state.slipx + state.Fy .= -state.h∇py .- state.slipy + # New equilibrium + Swalbe.equilibrium!(state, sys) + Swalbe.BGKandStream!(state, sys) + # New moments + Swalbe.moments!(state) + # Measurements, in this case only snapshots of simulational arrays + Swalbe.snapshot!(fluid, state.height, t, dumping = dump) + Swalbe.snapshot!(theta, θₛ, t, dumping = dump) + move_substrate!(state.slipx, θₛ, t, sub_speed, direction=dire) + end + return fluid, theta + if device == "GPU" + CUDA.reclaim() + end +end +# Well not most clean way but one one to freeze the substrate without having the x/0 issue. +function measure_substratewave( + sys::Swalbe.SysConst, + device::String, + move_sub::String; + h₀ = 1.0, + ϵ = 0.1, + wave_x=1, + wave_y=1, + sub_speed=100, + dump=1000, + θₛ=ones(sys.Lx, sys.Ly), + fluid=zeros(sys.param.Tmax÷dump, sys.Lx*sys.Ly), + theta=zeros(sys.param.Tmax÷dump, sys.Lx*sys.Ly), + dire = "x", + verbos=true, + T=Float64 +) + println("Simulating a time dependent substrate pattern") + state = Swalbe.Sys(sys, device) + if device == "CPU" + for i in 1:sys.Lx, j in 1:sys.Ly + state.height[i,j] = h₀ + ϵ * sin(2π*wave_x*(i-1)/sys.Lx) * sin(2π*wave_y*(j-1)/sys.Ly) + end + elseif device == "GPU" + h = zeros(size(state.height)) + for i in 1:sys.Lx, j in 1:sys.Ly + h[i,j] = h₀ + ϵ * sin(2π*wave_x*(i-1)/sys.Lx) * sin(2π*wave_y*(j-1)/sys.Ly) + end + # theta = CUDA.zeros(Float64, sys.Lx, sys.Ly) + state.height .= CUDA.adapt(CuArray, h) + end + Swalbe.equilibrium!(state, sys) + for t in 1:sys.param.Tmax + if t % sys.param.tdump == 0 + mass = 0.0 + mass = sum(state.height) + if verbos + println("Time step $t mass is $(round(mass, digits=3))") + println("Minimal thickness $(round(minimum(state.height), digits=3))") + end + end + + Swalbe.filmpressure!(state, sys, θ=θₛ) + Swalbe.h∇p!(state) + Swalbe.slippage2!(state, sys) + # Forces are the pressure gradient and the slippage due to substrate liquid boundary conditions + state.Fx .= -state.h∇px .- state.slipx + state.Fy .= -state.h∇py .- state.slipy + # New equilibrium + Swalbe.equilibrium!(state, sys) + Swalbe.BGKandStream!(state, sys) + # New moments + Swalbe.moments!(state) + # Measurements, in this case only snapshots of simulational arrays + Swalbe.snapshot!(fluid, state.height, t, dumping = dump) + Swalbe.snapshot!(theta, θₛ, t, dumping = dump) + end + return fluid, theta + CUDA.reclaim() +end + +function move_substrate!(θ, input, t, tmove; direction="diagonal") + if (t % tmove == 0) & (t > 0) + if direction == "diagonal" + circshift!(θ, input, (1,1)) + elseif direction == "x" + circshift!(θ, input, (1,0)) + elseif direction == "y" + circshift!(θ, input, (0,1)) + end + input .= θ + end + + return nothing +end + +println("Moving Wettability and possible resonaces") +speed_dict = Dict(1 => [0, 4900, 490, 49], + 2 => [0, 9802, 980, 98], + 3 => [0, 14702, 1470, 147], + 4 => [19603, 1960, 196], + 5 => [24504, 2450, 245], + 6 => [29404, 2940, 294], + 7 => [34305, 3430, 343], + 8 => [39206, 3920, 392], + 9 => [44107, 4410, 441], + 10 => 2*[24504, 2450, 245]) + +speed_dict_rup = Dict(1 => [980], + 2 => [980], + 3 => [980], + 4 => [980], + 5 => [980], + 6 => [980], + 7 => [980], + 8 => [980], + 9 => [980], + 10 => [980]) + +# To pin down the Rayleigh-Plateu instability +# v_lam2_dia_more = [490, 245, 164, 123] +# for theta_var in [1/24, 1/36, 1/64] # "diagonal" +direction = "diagonal" +# Different initial volumes +waves_num = 2 +theta_var = 1/36 +# speeds = speed_dict[waves_num] +run_on = "GPU" +for speed in [98]#speeds[3] 98 + pattern = "sine" + ang = 1/9 + TM = 5000000 # 5000000 + for slip in [1.0] + println("Simulating moving substrate wettability with pattern $(pattern) and moving direction $(direction) and speed $(speed)") + sys = Swalbe.SysConst(Lx=512, Ly=512, param=Swalbe.Taumucs(γ=0.01, δ=slip, μ=1/12, n=3, m=2, hmin=0.07, Tmax=5000000, tdump=5000)) + #sys = Swalbe.SysConst(Lx=512, Ly=512, γ=0.01, δ=1.0, n=3, m=2, hmin=0.07, Tmax=75000, tdump=500) + df_fluid = Dict() + df_sub = Dict() + θₚ = ones(sys.Lx,sys.Ly) + # Substrate patterning + if pattern == "sine" + for i in 1:sys.Lx, j in 1:sys.Ly + θₚ[i,j] = ang + theta_var * sin(2π*waves_num*(i-1)/sys.Lx) * sin(2π*waves_num*(j-1)/sys.Ly) + end + end + if run_on == "GPU" + # Make a cuarray with the substrate pattern + θ_in = CUDA.adapt(CuArray, θₚ) + if speed == 0 + # Actual simulation + println("No pattern velocity") + fluid, substrate = measure_substratewave(sys, run_on, "blub", sub_speed=speed, θₛ=θ_in, dire=direction, dump=sys.param.tdump) + else + println("Pattern velocity v_theta = $(speed)") + fluid, substrate = measure_substratewave(sys, run_on, sub_speed=speed, θₛ=θ_in, dire=direction, dump=sys.param.tdump) + end + elseif run_on == "CPU" + if speed == 0 + # Actual simulation + fluid, substrate = measure_substratewave(sys, run_on, "blub", sub_speed=speed, θₛ=θₚ, dire=direction, dump=sys.param.tdump) + else + fluid, substrate = measure_substratewave(sys, run_on, sub_speed=speed, θₛ=θₚ, dire=direction, dump=sys.param.tdump) + end + end + println("Writing measurements to Dict") + # Filling the dataframes + for t in 1:sys.param.Tmax÷sys.param.tdump + df_fluid["h_$(t*sys.param.tdump)"] = fluid[t,:] + df_sub["theta_$(t*sys.param.tdump)"] = substrate[t,:] + end + println("Saving Dict subdirection $direction subvel $speed and $(pattern) $waves_num to disk") + save_ang = Int(round(rad2deg(π*ang))) + save_ang_del = Int(round(rad2deg(π*theta_var))) + save("data/Moving_wettability/height_direc_$(direction)_sp_$(speed)_$(pattern)_$(waves_num)_$(save_ang)_del_$(save_ang_del)_tmax_$(sys.param.Tmax)_disj_$(sys.param.n)_slip_$(Int(10*slip)).jld2", df_fluid) + + CUDA.reclaim() + end +end + +println("Script done, let's have a look at the data :)") diff --git a/src/forcing.jl b/src/forcing.jl index 45e3684..ff7ae8c 100644 --- a/src/forcing.jl +++ b/src/forcing.jl @@ -58,6 +58,12 @@ slippage!(state::LBM_state_1D, sys::Consts_1D) = slippage!(state.slip, state.hei slippage!(state::Expanded_1D, sys::Consts_1D) = slippage!(state.basestate.slip, state.basestate.height, state.basestate.vel, sys.param.δ, sys.param.μ) +# Dirty hack for reducing slip length +function slippage2!(state::LBM_state_2D, sys::SysConst) + @. state.slipx .= (6sys.param.μ * (state.height+sys.param.hcrit) * state.velx) / (2 * (state.height+sys.param.hcrit)^2 + 6sys.param.δ * (state.height+sys.param.hcrit) + 3sys.param.δ^2 ) + @. state.slipy .= (6sys.param.μ * (state.height+sys.param.hcrit) * state.vely) / (2 * (state.height+sys.param.hcrit)^2 + 6sys.param.δ * (state.height+sys.param.hcrit) + 3sys.param.δ^2 ) + return nothing +end """ h∇p!(state) @@ -210,7 +216,7 @@ julia> Swalbe.thermal!(x, y, h, 0.1, 1/6, 1) julia> @test mean(x) ≈ 0.0 atol=1e-2 Test Passed - + julia> @test mean(y) ≈ 0.0 atol=1e-2 Test Passed diff --git a/src/initialvalues.jl b/src/initialvalues.jl index e8ea406..92ec135 100644 --- a/src/initialvalues.jl +++ b/src/initialvalues.jl @@ -332,7 +332,7 @@ julia> θ, P = Swalbe.ellipsepattern(ones(100,100), θ₀); # per default the ce julia> @test θ[1,1] == θ₀ Test Passed - + julia> @test θ[50,50] == θ₀ + 1/36 # The default increment, is about 5 degrees. Test Passed ``` diff --git a/src/measures.jl b/src/measures.jl index a6c09ca..9bc2b73 100644 --- a/src/measures.jl +++ b/src/measures.jl @@ -57,7 +57,7 @@ function t0(;hᵦ=0.07, γ=0.01, μ=1/6, θ=1/6) qsq = hᵦ * (1 - cospi(θ)) * (2 - 3 * hᵦ) charT = 3 * μ / (γ * qsq^2) - return charT + return charT, qsq end """ @@ -89,7 +89,6 @@ julia> Swalbe.snapshot!(snapshot,h2,20,dumping=10) julia> @test all(h1 .== reshape(snapshot[1,:],5,5)) Test Passed - julia> @test all(h2 .== reshape(snapshot[2,:],5,5)) Test Passed ``` diff --git a/src/moments.jl b/src/moments.jl index bda139f..8fdf0e9 100644 --- a/src/moments.jl +++ b/src/moments.jl @@ -62,7 +62,7 @@ function moments!(height::Vector, vel, fout) end moments!(state::LBM_state_2D) = moments!(state.height, state.velx, state.vely, state.fout) - +moments!(state::CuState) = moments!(state.height, state.velx, state.vely, state.fout) moments!(state::LBM_state_1D) = moments!(state.height, state.vel, state.fout) moments!(state::Expanded_2D) = moments!(state.basestate.height, state.basestate.velx, state.basestate.vely, state.basestate.fout) diff --git a/test/measures.jl b/test/measures.jl index c43894b..9c6c378 100644 --- a/test/measures.jl +++ b/test/measures.jl @@ -110,14 +110,13 @@ surf_cal[t] = sum(sqrt.(d1.^2 .+ d2.^2 .+ 1)) ener_cal[t] = surf_cal[t] - sum(cospi.(θ)) end - # There is some 10^(-10) round off errors... @test all(area_lv .≈ surf_cal) @test all(red_energy .≈ ener_cal) end @testset "Characteristic time scale" begin t_0 = Swalbe.t0() - @test t_0 ≈ 177428.32340802532 atol = 1e-7 + @test t_0[1] == 177428.32340802532 end @testset "Field snapshots" begin