-
Notifications
You must be signed in to change notification settings - Fork 132
Fix 6 low-risk pre-process bugs (batch) #1241
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
base: master
Are you sure you want to change the base?
Changes from all commits
f645127
ad4667d
6bd9bf7
0a7b4a3
680716e
dbbe35b
9ab9c37
097f6c7
9d7d4ab
22304a1
d614938
a9dbbe5
a8f0d84
4997be7
fe68c2f
d038c40
d261a84
d27fe4b
da4777c
2f6f0ac
7d501e4
2ba93f2
df91890
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,8 @@ | |
| !! @file | ||
| !! @brief Contains module m_start_up | ||
|
|
||
| #:include 'macros.fpp' | ||
|
|
||
| !> @brief Reads and validates user inputs, loads existing grid/IC data, and initializes pre-process modules | ||
| module m_start_up | ||
|
|
||
|
|
@@ -767,7 +769,8 @@ contains | |
|
|
||
| real(wp), intent(inout) :: start, finish | ||
|
|
||
| integer :: j, k | ||
| integer :: j, k, l | ||
| real(wp) :: r2 | ||
|
|
||
| ! Setting up the grid and the initial condition. If the grid is read in from | ||
| ! preexisting grid data files, it is checked for consistency. If the grid is | ||
|
|
@@ -787,10 +790,16 @@ contains | |
|
|
||
| ! hard-coded psi | ||
| if (hyper_cleaning) then | ||
| do j = 0, m | ||
| @:ASSERT(psi_idx > 0, "hyper_cleaning requires psi_idx to be set") | ||
| do l = 0, p | ||
| do k = 0, n | ||
| q_cons_vf(psi_idx)%sf(j, k, 0) = 1d-2*exp(-(x_cc(j)**2 + y_cc(k)**2)/(2.0*0.05**2)) | ||
| q_prim_vf(psi_idx)%sf(j, k, 0) = q_cons_vf(psi_idx)%sf(j, k, 0) | ||
| do j = 0, m | ||
| r2 = x_cc(j)**2 | ||
| if (n > 0) r2 = r2 + y_cc(k)**2 | ||
| if (p > 0) r2 = r2 + z_cc(l)**2 | ||
| q_cons_vf(psi_idx)%sf(j, k, l) = 1.0e-2_wp*exp(-r2/(2.0_wp*0.05_wp**2)) | ||
| q_prim_vf(psi_idx)%sf(j, k, l) = q_cons_vf(psi_idx)%sf(j, k, l) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good catch, i think. May be correct to ask @ChrisZYJ since I though the point of giving psi initial values was just to add some stability at the start, so I am surprised we went this long without finding this.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah this fix makes sense. It was my oversight for only initializing the 2D plane as I was initially only testing 2D cases. By construction, psi encodes the div B error so it propagates and dampens, and an initial mismatch just goes away, which is probably why it went unidentified. Now it's consistent and more stable. |
||
| end do | ||
| end do | ||
| end do | ||
| end if | ||
|
|
||
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.
This change is pointless. It just copies the values one at a time instead copying 3 at once. In fact, it is probably slightly slower.
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'm pretty sure this still broadcasts all three elements of each variable at the same time unless I'm missing something