-
Notifications
You must be signed in to change notification settings - Fork 133
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
32cb2da
c34851c
f7ab2da
630bb63
e4552bc
38f3be9
b985e53
2ae93a2
1c1d8ac
61f39b1
3b87205
7cb0512
44986bf
0ed89d3
3d15838
732146c
1cdd751
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