Skip to content
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

Add more NRBC treatment in the 1D Euler solver #330

Open
yungyuc opened this issue May 12, 2024 · 4 comments
Open

Add more NRBC treatment in the 1D Euler solver #330

yungyuc opened this issue May 12, 2024 · 4 comments
Labels
enhancement New feature or request onedim One-dimensional solver

Comments

@yungyuc
Copy link
Member

yungyuc commented May 12, 2024

PR #326 implemented a NRBC treatment for the 1D Euler solver. There are other variants that we should try.

The associated issue for adding notes: solvcon/mmnote#31

@yungyuc yungyuc added the onedim One-dimensional solver label May 12, 2024
@Gene0315
Copy link
Collaborator

截圖 2024-05-01 上午1 14 46 In the CESE method, the points j on boundary have a lack of data from outside points, so it is difficult to predict their value at next time step. Maybe one possible approach is to extend the half dx cell point outside the boundary (red cross icon in the diagram). Then, these j points on boundary will can be solved. Alternatively, we can avoid the situation by excluding these points j when plotting.

@yungyuc
Copy link
Member Author

yungyuc commented May 18, 2024

@Gene0315 I agree that we can also make the plotting look nicer. That can use a different issue to track. Could you please create one? (And associate that one with this.)

@Gene0315
Copy link
Collaborator

Gene0315 commented May 28, 2024

I try to use the second NRBC method with lambda=0. I think the zig-zag array could be shown simpely in the figure. The number 0~3 is the first index of m_so0 and m_so1.
截圖 2024-05-28 中午12 05 13

As I see it, the value at boundary point, such as m_so0(0, 1:3) and m_so1(0, 1:3), should be equal to the m_so0(1, 1:3) and m_so1(1, 1:3) before calculating the new value in next time step. Thus, I revised the “treat_boundary_so0()” and “treat_boundary_so1()” in “Euler1DCore.cp”.
截圖 2024-05-28 中午12 13 20
截圖 2024-05-28 中午12 13 34

And then, I changed the sequence of “treat_boundary_so0”, “treat_boundary_so1”, and “march_half_so0”. The sections I changed including

  • wrap_onedim.cpp
截圖 2024-05-28 中午12 16 18
  • core.hpp
截圖 2024-05-28 中午12 24 05
  • wrap_spacetime.cpp
截圖 2024-05-28 中午12 25 10
  • wrap_spacetime.hpp
截圖 2024-05-28 中午12 29 47
  • test_onedim_euler.py
截圖 2024-05-28 中午12 32 46
  • test_spacetime_solution.py
截圖 2024-05-28 中午12 32 38

But, after 200 time steps, the result showed
截圖 2024-05-28 中午12 33 36

@yungyuc
Copy link
Member Author

yungyuc commented May 28, 2024

@Gene0315 I agree that we can also make the plotting look nicer. That can use a different issue to track. Could you please create one? (And associate that one with this.)

@Gene0315 I wonder what is your response to this request?

And please do not attach images for showing code or diff like in your comment #330 (comment) . When you want to show plain text, use plain text format of markdown. For example, you can quote code diff like:

diff --git a/cpp/modmesh/onedim/Euler1DCore.cpp b/cpp/modmesh/onedim/Euler1DCore.cpp
index 8065d79..2eb9bde 100644
--- a/cpp/modmesh/onedim/Euler1DCore.cpp
+++ b/cpp/modmesh/onedim/Euler1DCore.cpp
@@ -179,7 +179,7 @@ void Euler1DCore::treat_boundary_so1()
     // Set outside value from inside value.
     {
         // Left boundary.
-        size_t const ic = 1;
+        size_t const ic = 0;
         m_so1(ic, 0) = m_so1(ic + 1, 0);
         m_so1(ic, 1) = m_so1(ic + 1, 1);
         m_so1(ic, 2) = m_so1(ic + 1, 2);

Code pasted in an image cannot be searched and is useless. We should not do it in GitHub.

It is easier to discuss for your question in #330 (comment) in a pull request. Please create one for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request onedim One-dimensional solver
Projects
Status: Todo
Development

No branches or pull requests

2 participants