Skip to content

Commit

Permalink
bug fix for energy diss
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand committed Apr 17, 2024
1 parent 23d00a9 commit 771b164
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
11 changes: 6 additions & 5 deletions examples/2D_barotropic/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json

# Numerical setup
Nx = 500
Nx = 200
dx = 1./(1.*(Nx+1))

Tend = 0.2
Expand Down Expand Up @@ -37,7 +37,7 @@
'p' : 0,
'dt' : mydt,
't_step_start' : 0,
't_step_stop' : 1000,
't_step_stop' : 5000,
't_step_save' : 10,
# ==========================================================================

Expand All @@ -49,7 +49,7 @@
'adv_alphan' : 'T',
'mpp_lim' : 'F',
'mixture_err' : 'F',
'time_stepper' : 4,
'time_stepper' : 3,
'weno_order' : 5,
'weno_eps' : 1.E-16,
'weno_Re_flux' : 'F',
Expand All @@ -64,15 +64,16 @@
'bc_x%end' : -1,
'bc_y%beg' : -1,
'bc_y%end' : -1,
'barotropic' : 'T',
'barotropic' : 'F',
'cu_mpi' : 'F',
# ==========================================================================

# Formatted Database Files Structure Parameters ============================
'format' : 1,
'precision' : 2,
'prim_vars_wrt' :'T',
'parallel_io' :'F',
'E_wrt' :'T',
'parallel_io' :'T',
# ==========================================================================


Expand Down
8 changes: 8 additions & 0 deletions examples/2D_barotropic/diss.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import numpy as np
import matplotlib.pyplot as plt
arr = np.loadtxt("En_tot_igr.dat")
arr2 = np.loadtxt("En_tot_weno.dat")
plt.semilogy(np.arange(np.size(arr)), arr, label = "igr + lw")
plt.semilogy(np.arange(np.size(arr)), arr2, label = "weno5 + rk")
plt.legend()
plt.savefig("diss.png", dpi=300)
4 changes: 2 additions & 2 deletions src/post_process/m_start_up.f90
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ subroutine s_save_data(t_step, varname, pres, c, H)
-offset_y%beg:n + offset_y%end, &
-offset_z%beg:p + offset_z%end)

q_sf = 2.5d0*q_prim_vf(E_idx)%sf + 0.5d0*q_prim_vf(1)%sf(j,k,l)*&
q_sf = 2.5d0*q_prim_vf(E_idx)%sf + 0.5d0*q_prim_vf(1)%sf*&
(q_prim_vf(mom_idx%beg)%sf**2d0 + q_prim_vf(mom_idx%beg + 1)%sf**2d0)

En_tot = 0d0
Expand All @@ -300,7 +300,7 @@ subroutine s_save_data(t_step, varname, pres, c, H)
end do
end do
En_tot = En_tot/((m+1)*(n+1))
!En_tot = En_tot - 0.59012242316857255
En_tot = En_tot - 0.59012242316857255
rho_tot = 0.5d0*(rho_tot/((m+1)*(n+1)))**1.4
print *, "POT AVG", rho_tot
print *, "En_tot", En_tot
Expand Down

0 comments on commit 771b164

Please sign in to comment.