-
Notifications
You must be signed in to change notification settings - Fork 112
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
Pointwise boundary surface values #1920
base: main
Are you sure you want to change the base?
Pointwise boundary surface values #1920
Conversation
Review checklistThis checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging. Purpose and scope
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
I currently have two issues
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1920 +/- ##
==========================================
- Coverage 96.34% 93.88% -2.46%
==========================================
Files 470 471 +1
Lines 37497 37626 +129
==========================================
- Hits 36125 35323 -802
- Misses 1372 2303 +931
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not do a full review, just left a question about the need to add another package dependency. As far as your other concerns here are my preliminary thoughts.
- A
.txt
file is fine as ACSII data can be post-processed by nearly any program. However, if we are willing to useDelimitedFiles
would something like.csv
be better? Just thinking out loud. - Since no integral is computed, then, as far as I understand it, the
analysis_integral
is basically being overloaded for easier dispatch purposes. Then the pointwise values are computed on the fly with similar drag and lift functions and the write-to-file occurs within the loop over all nodes instead of afterwards. My initial reaction is that this could be confusing. It would be better to be more explicit and create a new generic function called something likeanalysis_pointwise
that could still reuse the caches and such from theAnalysisCallback
struct.
examples/p4est_2d_dgsem/elixir_navierstokes_NACA0012airfoil_mach08.jl
Outdated
Show resolved
Hide resolved
I suggest we adapt/copy this code Trixi.jl/src/callbacks_step/analysis.jl Lines 583 to 607 in 6554973
to non-integrated quantities, i.e., some which are not returning a scalar value possibly like this: # Iterate over tuples of analysis integrals in a type-stable way using "lispy tuple programming".
function analyze_pointwise(analysis_quantities::NTuple{N, Any}, io, du, u, t,
semi) where {N}
# Extract the first analysis integral and process it; keep the remaining to be processed later
quantity = first(analysis_quantities)
remaining_quantities = Base.tail(analysis_quantities)
analyze(quantity, du, u, t, semi)
# Recursively call this method with the unprocessed integrals
analyze_integrals(remaining_quantities, io, du, u, t, semi)
return nothing
end and then call this here: Trixi.jl/src/callbacks_step/analysis.jl Lines 487 to 488 in 6554973
|
Regarding the type of file, I think we should aim for something that is easily post-processed, as now one does not get a single value but instead many, which are most likely also accompanied by spatial positions. |
I recommend to take a look at how I/O is implemented in the Overall, the decision on which file format to use IMHO depends heavily on data set size: If either the number of recording points or the number of recordings is at most 10-20, an ASCII file might still work. However, if you want to record at, say, 100 points, and do so for 1000 times over the course of a simulation, I'd probably opt for an HDF5 file. |
@Arpit-Babbar : I did some changes to be AMR-ready, see #1959 . Now the test fail, however. Can you take a look if we still match the reference data or if I messed something up? |
I regenerated the data and saw that both the plots look exactly the same as this. Did we remove the reordering (following Michael's suggestion?)? That will need the CI to be updated. |
That is good! Yes, the sorting is not longer done. |
I see it now. The sorting @test sort(cp_vals[1:10]) ≈ [1.5152278762705806
1.5182860925755697
1.7417814818119175
1.871513931283643
1.874247697759559
2.0354491762572806
2.0400855926847936
2.0956920203526193
2.098639791879171
2.1591959225932777] does not look equivalent to sorting along the increasing x direction. For that, you will have to sort along |
Yes, but this is also not intended. As you can see, the reference data is also sorting in ascending order, so I seek to do the same with the data, as I am not sure whether the order of the indices is deterministic. We match some values, while some we miss, see : https://github.com/trixi-framework/Trixi.jl/actions/runs/9810227214/job/27089931612?pr=1920#step:7:8617 |
I guess we could also move this into a package called |
This PR add pointwise values on the surface like the coefficient of pressure and friction.
The computation has been verified using the reference data from Roy Charles Swanson, Stefan Langer, Structured and Unstructured Grid Methods (2016)
The verification requires plotting along with reference data, for which the script is available at https://gist.github.com/Arpit-Babbar/924823c08f4be962856a99c107b18fb5
TODO