-
Notifications
You must be signed in to change notification settings - Fork 121
Equation Indices and BC Types - Issue (#828) #860
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
Changes from 1 commit
69a5312
f5554d4
d60b4ea
bf2a897
e689a6b
485b1cb
f50daac
11e1e71
4b813ab
b11682b
57f6b1a
6bd7e36
1e7c62b
37aa5d9
ac48caa
bd3269a
514b771
ab86026
f6fc6a0
74ccd77
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 |
|---|---|---|
|
|
@@ -97,29 +97,29 @@ | |
|
|
||
| ! Initialize the ip component of each ghost point | ||
| do i = 1, num_gps | ||
| allocate (ghost_points(i)%ip%alpha_rho(num_fluids)) | ||
| allocate (ghost_points(i)%ip%alpha(num_fluids)) | ||
| @:ALLOCATE(ghost_points(i)%ip%alpha_rho(num_fluids)) | ||
| @:ALLOCATE(ghost_points(i)%ip%alpha(num_fluids)) | ||
| ghost_points(i)%ip%vel = 0.0_wp | ||
| ghost_points(i)%ip%pressure = 0.0_wp | ||
|
|
||
| if (surface_tension) then | ||
| ghost_points(i)%ip%c = 0.0_wp | ||
| end if | ||
|
|
||
| if (bubbles_euler) then | ||
| allocate (ghost_points(i)%ip%r(nb)) | ||
| allocate (ghost_points(i)%ip%v(nb)) | ||
| @:ALLOCATE(ghost_points(i)%ip%r(nb)) | ||
| @:ALLOCATE(ghost_points(i)%ip%v(nb)) | ||
| if (.not. polytropic) then | ||
| allocate (ghost_points(i)%ip%pb(nb)) | ||
| allocate (ghost_points(i)%ip%mv(nb)) | ||
| @:ALLOCATE(ghost_points(i)%ip%pb(nb)) | ||
| @:ALLOCATE(ghost_points(i)%ip%mv(nb)) | ||
| end if | ||
| end if | ||
|
|
||
| if (qbmm) then | ||
| allocate (ghost_points(i)%ip%nmom(nb*nmom)) | ||
| @:ALLOCATE(ghost_points(i)%ip%nmom(nb*nmom)) | ||
| if (.not. polytropic) then | ||
| allocate (ghost_points(i)%ip%presb(nb*nnode)) | ||
| allocate (ghost_points(i)%ip%massv(nb*nnode)) | ||
| @:ALLOCATE(ghost_points(i)%ip%presb(nb*nnode)) | ||
| @:ALLOCATE(ghost_points(i)%ip%massv(nb*nnode)) | ||
| end if | ||
| end if | ||
| end do | ||
|
|
@@ -192,11 +192,11 @@ | |
|
|
||
| !Interpolate primitive variables at image point associated w/ GP | ||
| if (bubbles_euler .and. .not. qbmm) then | ||
| call s_interpolate_image_point(q_prim_vf, gp) | ||
| else if (qbmm .and. polytropic) then | ||
| call s_interpolate_image_point(q_prim_vf, gp) | ||
| else if (qbmm .and. .not. polytropic) then | ||
| call s_interpolate_image_point(q_prim_vf, gp, pb, mv) | ||
| else | ||
| call s_interpolate_image_point(q_prim_vf, gp) | ||
| end if | ||
|
|
@@ -211,17 +211,17 @@ | |
| end do | ||
|
|
||
| if (surface_tension) then | ||
| q_prim_vf(c_idx)%sf(j, k, l) = gp%ip%c | ||
| end if | ||
|
|
||
| if (model_eqns /= 4) then | ||
| ! If in simulation, use acc mixture subroutines | ||
| if (elasticity) then | ||
| call s_convert_species_to_mixture_variables_acc(rho, gamma, pi_inf, qv_K, & | ||
| gp%ip%alpha, gp%ip%alpha_rho, Re_K, j, k, l, G_K, Gs) | ||
| else if (bubbles_euler) then | ||
| call s_convert_species_to_mixture_variables_bubbles_acc(rho, gamma, pi_inf, qv_K, & | ||
| gp%ip%alpha, gp%ip%alpha_rho, Re_K, j, k, l) | ||
| else | ||
| call s_convert_species_to_mixture_variables_acc(rho, gamma, pi_inf, qv_K, & | ||
| gp%ip%alpha, gp%ip%alpha_rho, Re_K, j, k, l) | ||
|
|
@@ -255,36 +255,36 @@ | |
|
|
||
| ! Set color function | ||
| if (surface_tension) then | ||
| q_cons_vf(c_idx)%sf(j, k, l) = gp%ip%c | ||
| end if | ||
|
|
||
| ! Set Energy | ||
| if (bubbles_euler) then | ||
| q_cons_vf(E_idx)%sf(j, k, l) = (1 - gp%ip%alpha(1))*(gamma*gp%ip%pressure + pi_inf + dyn_pres) | ||
| else | ||
| q_cons_vf(E_idx)%sf(j, k, l) = gamma*gp%ip%pressure + pi_inf + dyn_pres | ||
| end if | ||
|
|
||
| ! Set bubble vars | ||
| if (bubbles_euler .and. .not. qbmm) then | ||
| call s_comp_n_from_prim(gp%ip%alpha(1), gp%ip%r, nbub, weight) | ||
| do q = 1, nb | ||
| if (polytropic) then | ||
| q_cons_vf(bubxb + (q - 1)*2)%sf(j, k, l) = nbub*gp%ip%r(q) | ||
| q_cons_vf(bubxb + (q - 1)*2 + 1)%sf(j, k, l) = nbub*gp%ip%v(q) | ||
| else | ||
| q_cons_vf(bubxb + (q - 1)*4)%sf(j, k, l) = nbub*gp%ip%r(q) | ||
| q_cons_vf(bubxb + (q - 1)*4 + 1)%sf(j, k, l) = nbub*gp%ip%v(q) | ||
| q_cons_vf(bubxb + (q - 1)*4 + 2)%sf(j, k, l) = nbub*gp%ip%pb(q) | ||
| q_cons_vf(bubxb + (q - 1)*4 + 3)%sf(j, k, l) = nbub*gp%ip%mv(q) | ||
| end if | ||
| end do | ||
| end if | ||
|
|
||
| if (qbmm) then | ||
| nbub = gp%ip%nmom(1) | ||
| do q = 1, nb*nmom | ||
| q_cons_vf(bubxb + q - 1)%sf(j, k, l) = nbub*gp%ip%nmom(q) | ||
| end do | ||
| do q = 1, nb | ||
| q_cons_vf(bubxb + (q - 1)*nmom)%sf(j, k, l) = nbub | ||
|
|
@@ -293,8 +293,8 @@ | |
| if (.not. polytropic) then | ||
| do q = 1, nb | ||
| do r = 1, nnode | ||
| pb(j, k, l, r, q) = gp%ip%presb((q - 1)*nnode + r) | ||
| mv(j, k, l, r, q) = gp%ip%massv((q - 1)*nnode + r) | ||
| end do | ||
| end do | ||
| end if | ||
|
|
@@ -329,16 +329,16 @@ | |
|
|
||
| !$acc loop seq | ||
| do q = 1, num_fluids | ||
| q_prim_vf(q)%sf(j, k, l) = gp%ip%alpha_rho(q) | ||
| q_prim_vf(advxb + q - 1)%sf(j, k, l) = gp%ip%alpha(q) | ||
| end do | ||
|
|
||
| if (surface_tension) then | ||
| q_prim_vf(c_idx)%sf(j, k, l) = gp%ip%c | ||
| end if | ||
|
|
||
| call s_convert_species_to_mixture_variables_acc(rho, gamma, pi_inf, qv_K, gp%ip%alpha, & | ||
| gp%ip%alpha_rho, Re_K, j, k, l) | ||
|
|
||
| dyn_pres = 0._wp | ||
|
|
||
|
|
@@ -757,7 +757,7 @@ | |
|
|
||
| !> Function that uses the interpolation coefficients and the current state | ||
| !! at the cell centers in order to estimate the state at the image point | ||
| pure subroutine s_interpolate_image_point(q_prim_vf, gp, pb, mv) | ||
|
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 an good example of what i was talking about above... for removing so many arguments.
Collaborator
Author
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. yup yup I see that |
||
| !$acc routine seq | ||
| type(scalar_field), & | ||
| dimension(sys_size), & | ||
|
|
@@ -788,19 +788,19 @@ | |
| if (surface_tension) gp%ip%c = 0._wp | ||
|
|
||
| if (bubbles_euler) then | ||
| gp%ip%r = 0._wp | ||
| gp%ip%v = 0._wp | ||
| if (.not. polytropic) then | ||
| gp%ip%pb = 0._wp | ||
| gp%ip%mv = 0._wp | ||
| end if | ||
| end if | ||
|
|
||
| if (qbmm) then | ||
| gp%ip%nmom = 0._wp | ||
| if (.not. polytropic) then | ||
| gp%ip%presb = 0._wp | ||
| gp%ip%massv = 0._wp | ||
| end if | ||
| end if | ||
|
|
||
|
|
@@ -814,52 +814,52 @@ | |
| coeff = gp%interp_coeffs(i - i1 + 1, j - j1 + 1, k - k1 + 1) | ||
|
|
||
| gp%ip%pressure = gp%ip%pressure + coeff* & | ||
| q_prim_vf(E_idx)%sf(i, j, k) | ||
|
|
||
| !$acc loop seq | ||
| do q = momxb, momxe | ||
| gp%ip%vel(q + 1 - momxb) = gp%ip%vel(q + 1 - momxb) + coeff* & | ||
| q_prim_vf(q)%sf(i, j, k) | ||
| end do | ||
|
|
||
| !$acc loop seq | ||
| do l = contxb, contxe | ||
| gp%ip%alpha_rho(l) = gp%ip%alpha_rho(l) + coeff* & | ||
| q_prim_vf(l)%sf(i, j, k) | ||
| gp%ip%alpha(l) = gp%ip%alpha(l) + coeff* & | ||
| q_prim_vf(advxb + l - 1)%sf(i, j, k) | ||
| end do | ||
|
|
||
| if (surface_tension) then | ||
| gp%ip%c = gp%ip%c + coeff*q_prim_vf(c_idx)%sf(i, j, k) | ||
| end if | ||
|
|
||
| if (bubbles_euler .and. .not. qbmm) then | ||
| !$acc loop seq | ||
| do l = 1, nb | ||
| if (polytropic) then | ||
| gp%ip%r(l) = gp%ip%r(l) + coeff*q_prim_vf(bubxb + (l - 1)*2)%sf(i, j, k) | ||
| gp%ip%v(l) = gp%ip%v(l) + coeff*q_prim_vf(bubxb + 1 + (l - 1)*2)%sf(i, j, k) | ||
| else | ||
| gp%ip%r(l) = gp%ip%r(l) + coeff*q_prim_vf(bubxb + (l - 1)*4)%sf(i, j, k) | ||
| gp%ip%v(l) = gp%ip%v(l) + coeff*q_prim_vf(bubxb + 1 + (l - 1)*4)%sf(i, j, k) | ||
| gp%ip%pb(l) = gp%ip%pb(l) + coeff*q_prim_vf(bubxb + 2 + (l - 1)*4)%sf(i, j, k) | ||
| gp%ip%mv(l) = gp%ip%mv(l) + coeff*q_prim_vf(bubxb + 3 + (l - 1)*4)%sf(i, j, k) | ||
| end if | ||
| end do | ||
| end if | ||
|
|
||
| if (qbmm) then | ||
| do l = 1, nb*nmom | ||
| gp%ip%nmom(l) = gp%ip%nmom(l) + coeff*q_prim_vf(bubxb - 1 + l)%sf(i, j, k) | ||
| end do | ||
| if (.not. polytropic) then | ||
| do q = 1, nb | ||
| do l = 1, nnode | ||
| gp%ip%presb((q - 1)*nnode + l) = gp%ip%presb((q - 1)*nnode + l) + & | ||
| coeff*pb(i, j, k, l, q) | ||
| gp%ip%massv((q - 1)*nnode + l) = gp%ip%massv((q - 1)*nnode + l) + & | ||
| coeff*mv(i, j, k, l, q) | ||
| end do | ||
| end do | ||
| end if | ||
|
|
@@ -872,27 +872,14 @@ | |
|
|
||
| !> Subroutine to deallocate memory reserved for the IBM module | ||
| impure subroutine s_finalize_ibm_module() | ||
| integer :: i | ||
|
|
||
| if (allocated(ghost_points)) then | ||
| do i = 1, size(ghost_points) | ||
| if (allocated(ghost_points(i)%ip%alpha_rho)) deallocate (ghost_points(i)%ip%alpha_rho) | ||
| if (allocated(ghost_points(i)%ip%alpha)) deallocate (ghost_points(i)%ip%alpha) | ||
| if (allocated(ghost_points(i)%ip%r)) deallocate (ghost_points(i)%ip%r) | ||
| if (allocated(ghost_points(i)%ip%v)) deallocate (ghost_points(i)%ip%v) | ||
| if (allocated(ghost_points(i)%ip%pb)) deallocate (ghost_points(i)%ip%pb) | ||
| if (allocated(ghost_points(i)%ip%mv)) deallocate (ghost_points(i)%ip%mv) | ||
| if (allocated(ghost_points(i)%ip%nmom)) deallocate (ghost_points(i)%ip%nmom) | ||
| if (allocated(ghost_points(i)%ip%presb)) deallocate (ghost_points(i)%ip%presb) | ||
| if (allocated(ghost_points(i)%ip%massv)) deallocate (ghost_points(i)%ip%massv) | ||
| end do | ||
| end if | ||
|
|
||
|
Collaborator
Author
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. Do you mind checking out this line? |
||
| if (allocated(ghost_points)) deallocate(ghost_points) | ||
|
|
||
| @:DEALLOCATE(ib_markers%sf) | ||
| @:DEALLOCATE(levelset%sf) | ||
| @:DEALLOCATE(levelset_norm%sf) | ||
| @:DEALLOCATE(ghost_points) | ||
| @:DEALLOCATE(inner_points) | ||
|
|
||
| end subroutine s_finalize_ibm_module | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -940,7 +940,7 @@ contains | |
|
|
||
| elseif (bubbles_lagrange) then | ||
|
|
||
| call s_populate_variables_buffers(q_prim_vf, pb_ts(1)%sf, mv_ts(1)%sf, bc_type, bc_flag) | ||
| call s_populate_variables_buffers(q_prim_vf, pb_ts(1)%sf, mv_ts(1)%sf, bc_type, bc_bound) | ||
| call s_compute_bubble_EL_dynamics(q_cons_ts(1)%vf, q_prim_vf, t_step, rhs_vf, stage) | ||
|
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. is this correct? looks like a breaking change to the subroutine call? or maybe this is from a merge conflict you fixed |
||
| call s_transfer_data_to_tmp() | ||
| call s_smear_voidfraction() | ||
|
|
||
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.
one advantage of this strategy of using more derived types is that we can just pass in
gp%ip(for ibm) orstate%L(or something like this) for riemann solvers. basically gathering all the data that could exist at a given point and lumping it into a derived type, and then the argument list becomes very short. for example, you just pass incall s_routine(state)where