-
Notifications
You must be signed in to change notification settings - Fork 17
Validation Oscillating Beam #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
246 commits
Select commit
Hold shift + click to select a range
e541ce8
add interpolation
svchb d09e779
basic working
svchb fd3c98b
support periodic
svchb 118585b
allow to define different smoothing_length
svchb a4e306d
more precisely identify system regions
svchb d0d4e85
to improve accuracy calc shepard
svchb 7f11ce6
add support for multiple points
svchb 2d7334c
add line interpolation
svchb 0a5a580
add doc
svchb 2c10d6c
format
svchb 69e8ddf
add test
svchb 567e1fb
Merge branch 'main' into add_interpolation
svchb 27065cc
small change to doc
svchb 238671e
revert accidental change
svchb 1512816
fix
svchb 959e36e
another fix
svchb a0c9694
format
svchb b0a22e4
format
svchb 9f3b68b
also interpolate pressure and velocity
svchb c83061e
lower tolerance
svchb f9b8bef
add example plot
svchb 54ffa68
missing dependency
svchb 9d2b15e
format
svchb 51567d6
add func
svchb a7786fd
add doc
svchb 4278910
add test
svchb fcfb065
add another test
svchb 9106912
comment out example
svchb 363bfcb
remove pyplot again
svchb 5a89022
fix
svchb 589f7b3
format
svchb 3351d74
small update improve accuracy
svchb a995d03
Merge branch 'main' into plane_interpolation
svchb 6044f55
Merge branch 'plane_interpolation' of github.com:svchb/TrixiParticles…
svchb cd8ddc5
update
svchb f6b3829
up
svchb 7a5c42e
fix
svchb c6165f0
format
svchb 8c58ff6
add JSON library
svchb e5dd805
postprocess_callback
svchb 23dca83
add rect_3d example
svchb 235f72a
fix
svchb 66af558
format
svchb a9c99bb
Merge branch 'main' into sensor_cb
svchb 46c9ae7
Merge branch 'more_fixes_for_risc' into sensor_cb
svchb bf4997d
impl
svchb 4e17772
Merge branch 'main' into sensor_cb
svchb d9e854e
fixes
svchb 22d8789
fix setting the interval
svchb e5d2bef
impl other functions
svchb 9226364
Merge branch 'main' into plane_interpolation
svchb 6136f7d
fix plots
svchb 8cddffa
fix plots.jl plot
svchb f4c2204
cleanup
svchb fb16b70
fix tests
svchb 1b450dd
cleanup
svchb babdde0
cleanup
svchb 3025102
fix docs
svchb bb57d18
fix doc
svchb a865c41
remove unused func
svchb 073558c
remove unused code
svchb 6b9bb14
fix
svchb a99f4ee
write missing values
svchb 3d8a6d3
replace incorrect nomenclature
svchb e9ced79
calc von mises stress
svchb e0af8eb
rm comment
svchb 743cdad
format
svchb 043a90e
change docs to F
svchb 4e01f48
add test
svchb 2795bb3
format
svchb 22c2acb
Merge branch 'main' into sensor_cb
svchb d73dbe7
fix merge
svchb 3671952
move files
svchb ff6bf1b
include exclude bnd
svchb 5891e7f
add version info to meta data
svchb 974859e
fix
svchb 9afa33b
add filename and overwrite
svchb c69650a
write initial values
svchb e91d529
format
svchb d81e4f9
add helper function to obtain latest file
svchb 10f0658
improve func
svchb b41ad2c
format
svchb 8e85162
fix plots
svchb 95a1e48
rename
svchb d603ebf
add doc
svchb 10b70fd
add exports
svchb 69043c5
cleanup
svchb ad313fe
cleanup
svchb 3863ccc
format
svchb 81d9e2b
Merge branch 'plane_interpolation' into sensor_cb3
svchb 93e3310
working example
svchb aa25735
add plot
svchb 6e1d805
also save the cauchy stress components
svchb 46661b4
format
svchb 769ca47
fix dt
svchb a9fbf6d
fix
svchb 1893ae9
fix
svchb 497bcd4
fix viscosity
svchb 9486a04
working 3d example for plane interpolation
svchb 586f639
add 2d plot as well for 3d case
svchb 8659c44
add docs
svchb e2f991d
fix tests
svchb cf5558f
fix
svchb e62453c
fix plot
svchb 699beaa
fix comments
svchb 3e7ad09
fix comment
svchb 971be6f
update
svchb db52b69
format
svchb e47ae70
add Plots
svchb 86837d1
fix
svchb 12ff4ef
adjust plot
svchb 010ddb9
reduce time
svchb def6be7
Merge remote-tracking branch 'refs/remotes/origin/plane_interpolation'
svchb 9389659
Merge remote-tracking branch 'origin/sensor_cb' into sensor_cb3
svchb 3967441
Merge branch 'save_TLSPH' into sensor_cb3
svchb 90cbdaa
add reference
svchb 04e62b9
add better digitized curves and error calc
svchb 3df6e54
performance optimization and some slight adjustment to improve error
svchb 95bf29e
Merge branch 'main' into sensor_cb
svchb b246c78
Merge branch 'main'
svchb 21ec719
format
svchb 8da0acd
update
svchb 550e032
Merge branch 'main' into sensor_cb
svchb c88bb7f
format
svchb 895925b
Merge branch 'sensor_cb' of github.com:svchb/TrixiParticles.jl into s…
svchb 8a7da40
Merge branch 'main' into sensor_cb3
svchb 0515b84
add reference files
svchb a648f57
Merge branch 'main' into sensor_cb
svchb 8108bd7
add CSV
svchb 22d71b4
add csv output
svchb 8175205
Merge branch 'sensor_cb' of github.com:svchb/TrixiParticles.jl into s…
svchb c0a1794
Merge branch 'main' into sensor_cb
svchb 94a4fa1
format
svchb 3755d4f
Merge branch 'sensor_cb' of github.com:svchb/TrixiParticles.jl into s…
svchb 65c3b0b
Merge branch 'main' into sensor_cb
svchb f835aa5
up
svchb f9693fc
Merge branch 'main' into sensor_cb
svchb 0cc4e08
fixes
svchb 82f8d5e
update
svchb 7975a7b
Merge branch 'sensor_cb' of github.com:svchb/TrixiParticles.jl into s…
svchb 07017b3
fix paths
svchb b1cd1fd
fixes
svchb 58691fa
review
svchb 1ac5e2d
review
svchb b1ca149
change git
svchb cd2f7ca
change type
svchb ceacf7e
remove mutable
svchb b12a122
add new example
svchb 92a88fa
change to plots.jl
svchb b22bccb
increase the resolution
svchb 4e156d2
include into CI
svchb 20b0c75
move condition
svchb 6e3a999
add more output to summary box
svchb 5f27c34
update
svchb d7cd92c
remove DataEntry
svchb dc6905c
Merge branch 'sensor_cb' into sensor_cb3
svchb 70490c8
update file structure
svchb bc84f81
fix setup
svchb 3e34bce
fix plot
svchb 44b6551
Merge branch 'main' into sensor_cb
svchb 8975bf3
update
svchb 13189a5
Merge branch 'main' into sensor_cb
svchb 1e9f532
fix
svchb c696664
update
svchb e38972d
format
svchb 6bf1d93
review update
svchb 439845f
fix test
svchb aebd697
nvalue->n_values
svchb b2c9d2d
fix
svchb f1a073d
fixfix
svchb 8ef914e
add check for anonymous functions
svchb 08bf3f3
fix test
svchb 61271d1
remove unused 'using'
svchb 71d2efa
add simple test
svchb 5a35aa0
fix using statements
svchb 03b4b81
ignore
svchb 4fc8d5c
format
svchb 5533585
fix ignore string
svchb 481bc79
fix json reading in example
svchb 338b8d1
update
svchb aae9f22
update based on review comments
svchb 521b42e
format
svchb f327cd0
change funcs to keyword args
svchb fd98f91
fix docs
svchb 0008c52
format
svchb 3c6e9c5
review comments
svchb 0c7a049
format
svchb 2611e73
Merge branch 'main' into sensor_cb
svchb 128ce2e
fix tests
svchb 153d0e0
fix test
svchb 0e4a6ab
format
svchb 3eb44a8
review
svchb 7852782
format
svchb b11ad70
fix plot
svchb ba39f94
fix test
svchb c43fcf2
remove include
svchb db38d89
Merge branch 'main' into sensor_cb
efaulhaber 93932c5
fix test
svchb be5a9be
Merge branch 'sensor_cb' of github.com:svchb/TrixiParticles.jl into s…
svchb 25509d6
Merge branch 'sensor_cb' into sensor_cb3
svchb 40e8a6f
Merge branch 'main' into sensor_cb3
svchb 283e5f3
rm
svchb acd15a5
move
svchb bc6d75a
add reference curves
svchb 5ba46e0
fix plot
svchb c6184f4
fix
svchb 7f99b36
add files
svchb 8a5c9ea
update
svchb 217f9c3
cleanup
svchb 8293d8e
format
svchb 7437abc
update
svchb ecbdb3b
cleanup plot
svchb 97d0e6c
simplify plot
svchb 6ea4bea
switch to makie
svchb b0ad145
implement check
svchb 3e7ee92
format
svchb 21c7bcd
update to new reference
svchb b7c0911
update
svchb 95eecd4
format
svchb 178e68b
rename
svchb 4714431
remove the dependencies
svchb cbeee99
remove dependencies
svchb 30b7e5f
add 5 resolution back
svchb b4112b4
format
svchb caca014
Merge branch 'main' into sensor_cb3
svchb ca0efab
use include
svchb fcf2da1
format
svchb 2f2740a
renaming
svchb b1f1d58
fix readme
svchb 4d46ef0
fix test [skip ci]
svchb 222b8b0
[skip ci] remove save for compare
svchb 552c0af
[skip ci] add tspan back
svchb 9998b53
review comments
svchb 0bf9b85
small fixes [skip ci]
svchb 162540a
update [skip ci]
svchb ccdf42c
rename [skip ci]
svchb b2d66b9
update [skip ci]
svchb dbc0a7f
fix
svchb ea2684c
exchange interpolation function
svchb 9ae2ba2
rename
svchb f836223
exchange common time range find code
svchb d92399e
update reference file
svchb 8324939
update [skip ci]
svchb 2f26a18
format [skip ci]
svchb d2ba9c8
update
svchb 071d527
Merge branch 'main' into sensor_cb3
svchb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| The following files are provided here: | ||
|
|
||
| 1) Validation simulation: validation_oscillating_beam_2d.jl | ||
| 2) Comparison with reference: compare_reference_oscillating_beam_results.jl | ||
| 3) Comparison with TrixiParticles.jl and literature reference: plot_oscillating_beam_results.jl | ||
| 4) TrixiParticles.jl reference files: validation_reference_[5, 9, 21, 35].j (5 is the default CI resolution, note that resolution 21 takes about 30-50 minutes while 35 takes about 4-6 hours) | ||
| 5) Reference file reference_turek.csv extracted from the file csm3_l4_t0p005.point here: | ||
| https://wwwold.mathematik.tu-dortmund.de/~featflow/en/benchmarks/cfdbenchmarking/fsi_benchmark/fsi_tests/fsi_csm_tests.html | ||
|
|
80 changes: 80 additions & 0 deletions
80
validation/oscillating_beam_2d/plot_oscillating_beam_results.jl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| include("../validation_util.jl") | ||
|
|
||
| # Activate for interactive plot | ||
| # using GLMakie | ||
| using CairoMakie | ||
| using CSV | ||
| using DataFrames | ||
| using JSON | ||
| using Glob | ||
| using Printf | ||
| using TrixiParticles | ||
|
|
||
| elastic_plate = (length=0.35, thickness=0.02) | ||
|
|
||
| # Load the reference simulation data | ||
| ref = CSV.read(joinpath(validation_dir(), "oscillating_beam_2d/reference_turek.csv"), | ||
| DataFrame) | ||
|
|
||
| # Get the list of JSON files | ||
| reference_files = glob("validation_reference_*.json", | ||
| joinpath(validation_dir(), "oscillating_beam_2d")) | ||
| simulation_files = glob("validation_run_oscillating_beam_2d_*.json", | ||
| joinpath(pkgdir(TrixiParticles), "out")) | ||
| merged_files = vcat(reference_files, simulation_files) | ||
| input_files = sort(merged_files, by=extract_number) | ||
|
|
||
| # Regular expressions for matching keys | ||
| key_pattern_x = r"deflection_x_solid_\d+" | ||
| key_pattern_y = r"deflection_y_solid_\d+" | ||
|
|
||
| # Setup for Makie plotting | ||
| fig = Figure(size=(1200, 800)) | ||
| ax1 = Axis(fig, title="X-Axis Displacement", xlabel="Time [s]", ylabel="X Displacement") | ||
| ax2 = Axis(fig, title="Y-Axis Displacement", xlabel="Time [s]", ylabel="Y Displacement") | ||
| fig[1, 1] = ax1 | ||
| fig[2, 1] = ax2 | ||
|
|
||
| for file_name in input_files | ||
| println("Loading the input file: $file_name") | ||
| json_data = JSON.parsefile(file_name) | ||
|
|
||
| resolution = parse(Int, split(split(file_name, "_")[end], ".")[1]) | ||
| particle_spacing = elastic_plate.thickness / (resolution - 1) | ||
|
|
||
| matching_keys_x = sort(collect(filter(key -> occursin(key_pattern_x, key), | ||
| keys(json_data)))) | ||
| matching_keys_y = sort(collect(filter(key -> occursin(key_pattern_y, key), | ||
| keys(json_data)))) | ||
|
|
||
| if isempty(matching_keys_x) | ||
| error("No matching keys found in: $file_name") | ||
| end | ||
|
|
||
| label_prefix = occursin("reference", file_name) ? "Reference" : "" | ||
|
|
||
| for (matching_keys, ax) in ((matching_keys_x, ax1), (matching_keys_y, ax2)) | ||
| for key in matching_keys | ||
| data = json_data[key] | ||
| times = Float64.(data["time"]) | ||
| displacements = Float64.(data["values"]) | ||
|
|
||
| mse_results = occursin(key_pattern_x, key) ? | ||
| interpolated_mse(ref.time, ref.Ux, data["time"], displacements) : | ||
| interpolated_mse(ref.time, ref.Uy, data["time"], displacements) | ||
|
|
||
| label = "$label_prefix dp = $(@sprintf("%.8f", particle_spacing)) mse=$(@sprintf("%.8f", mse_results))" | ||
| lines!(ax, times, displacements, label=label) | ||
| end | ||
| end | ||
| end | ||
|
|
||
| # Plot reference data | ||
| lines!(ax1, ref.time, ref.Ux, color=:black, linestyle=:dash, | ||
| label="Turek and Hron 2006") | ||
| lines!(ax2, ref.time, ref.Uy, color=:black, linestyle=:dash, | ||
| label="Turek and Hron 2006") | ||
|
|
||
| legend_ax1 = Legend(fig[1, 2], ax1) | ||
| legend_ax2 = Legend(fig[2, 2], ax2) | ||
| fig |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.