Skip to content

Commit

Permalink
GEM run
Browse files Browse the repository at this point in the history
  • Loading branch information
UCaromel committed Aug 1, 2024
1 parent 2daa8af commit 9fc4b12
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 202 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ currentres/
whislerwaveres/
whislerwavelin/
whislerwaveHLL/
hallharrisres/

debug/
frames/
pyMHD/pyMHD.cpython*
4 changes: 2 additions & 2 deletions diagnostics/whistlerwave/fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
nx = 128
Dx = 0.1

Dt = 0.002411
finalTime = 10
Dt = 0.0025
finalTime = 1

column_names = ['rho', 'vx', 'vy', 'vz', 'Bx', 'By', 'Bz', 'P']

Expand Down
94 changes: 0 additions & 94 deletions diagnostics/whistlerwave/plotFlux.py

This file was deleted.

95 changes: 0 additions & 95 deletions diagnostics/whistlerwave/plotJ.py

This file was deleted.

4 changes: 2 additions & 2 deletions diagnostics/whistlerwave/plot_anim.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Dx = 0.1


quantity_name = 'Bx'
quantity_name = 'By'
fixed_index = 0
ny = 1

Expand Down Expand Up @@ -89,7 +89,7 @@ def update(frame):

w = (k**2 /2) *(np.sqrt(1+4/k**2) + 1)

expected_value = 1e-7 * np.cos(k * x + w * times[frame] + 0.5488135)
expected_value = 1e-7 * np.cos(k * x - w * times[frame] + 0.5488135)

plt.clf()
plt.plot(x, quantities[quantity_name][frame, fixed_index, :], color='blue', marker = 'x', markersize=3) # t,y,x
Expand Down
6 changes: 3 additions & 3 deletions diagnostics/whistlerwave/whislerwaveX.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
ny = 1
Dx = 0.1
Dy = 1
Dt = 0.0
Dt = 0.0025
FinalTime = 1
nghost = 2

Expand All @@ -34,6 +34,7 @@
##############################################################################################################################################################################
lx=nx*Dx
k=2*np.pi/lx
cw = (k/2) + (np.sqrt(1+k**2/4))

np.random.seed(0)

Expand All @@ -48,14 +49,13 @@ def vx_(x, y):

def vy_(x, y):
ret = np.zeros((x.shape[0], y.shape[1]))
w = (k**2 /2) *(np.sqrt(1+4/k**2) + 1)

for m,phi in zip(modes, phases):
ret[:,:] += -np.cos(k*x*m + phi)*1e-7*k
return ret

def vz_(x, y):
ret = np.zeros((x.shape[0], y.shape[1]))
w = (k**2 /2) *(np.sqrt(1+4/k**2) + 1)
for m,phi in zip(modes, phases):
ret[:,:] += np.sin(k*x*m + phi)*1e-7*k
return ret
Expand Down
4 changes: 2 additions & 2 deletions diagnostics/whistlerwave/whislerwaveY.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
ny = 128
Dx = 1
Dy = 0.1
Dt = 0.0
FinalTime = 1.2
Dt = 0.0025
FinalTime = 1
nghost = 2

boundaryconditions = p.BoundaryConditions.Periodic
Expand Down
8 changes: 4 additions & 4 deletions src/Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ Interface::Interface(const PrimitiveVariables& P_cc /* Assuming ghost cells are
if (OptP == OptionalPhysics::HallResHyper) {
double vwx = (std::sqrt(1 + 0.25/(Dx*Dx)) + 0.5/Dx);
double vwy = (std::sqrt(1 + 0.25/(Dy*Dy)) + 0.5/Dy);
cwxL = std::sqrt(uL.Bx*uL.Bx + uL.By*uL.By + uL.Bz*uL.Bz) / (uL.rho * Dx) ;//* vwx;
cwyL = std::sqrt(uL.Bx*uL.Bx + uL.By*uL.By + uL.Bz*uL.Bz) / (uL.rho * Dy) ;//* vwy;
cwxR = std::sqrt(uR.Bx*uR.Bx + uR.By*uR.By + uR.Bz*uR.Bz) / (uR.rho * Dx) ;//* vwx;
cwyR = std::sqrt(uR.Bx*uR.Bx + uR.By*uR.By + uR.Bz*uR.Bz) / (uR.rho * Dy) ;//* vwy;
cwxL = std::sqrt(uL.Bx*uL.Bx + uL.By*uL.By + uL.Bz*uL.Bz) / (uL.rho) * vwx;
cwyL = std::sqrt(uL.Bx*uL.Bx + uL.By*uL.By + uL.Bz*uL.Bz) / (uL.rho) * vwy;
cwxR = std::sqrt(uR.Bx*uR.Bx + uR.By*uR.By + uR.Bz*uR.Bz) / (uR.rho) * vwx;
cwyR = std::sqrt(uR.Bx*uR.Bx + uR.By*uR.By + uR.Bz*uR.Bz) / (uR.rho) * vwy;
//double hallxL = std::sqrt(uL.Bx*uL.Bx + uL.By*uL.By + uL.Bz*uL.Bz) / (2.0*(uL.rho)*Dx);
//double hallyL = std::sqrt(uL.Bx*uL.Bx + uL.By*uL.By + uL.Bz*uL.Bz) / (2.0*(uL.rho)*Dy);
//double hallxR = std::sqrt(uR.Bx*uR.Bx + uR.By*uR.By + uR.Bz*uR.Bz) / (2.0*(uR.rho)*Dx);
Expand Down

0 comments on commit 9fc4b12

Please sign in to comment.