Skip to content
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

add a new way to do the MHD half-step update #1121

Draft
wants to merge 6 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Source/mhd/Castro_mhd.H
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
amrex::Array4<amrex::Real const> const& flxd2,
amrex::Array4<amrex::Real const> const& Ed1,
amrex::Array4<amrex::Real const> const& Ed3,
amrex::Array4<amrex::Real const> const& Ex,
amrex::Array4<amrex::Real const> const& Ey,
amrex::Array4<amrex::Real const> const& Ez,
const int d1, const int d2, const int d3,
const amrex::Real dt);

Expand All @@ -95,8 +98,19 @@
amrex::Array4<amrex::Real const> const& Ed,
amrex::Array4<amrex::Real const> const& Ed1,
amrex::Array4<amrex::Real const> const& Ed2,
amrex::Array4<amrex::Real const> const& Ex,
amrex::Array4<amrex::Real const> const& Ey,
amrex::Array4<amrex::Real const> const& Ez,
const int d, const int d1, const int d2, const amrex::Real dt);

void
get_inplane_Bs_transverse_flux(const int face, const int comp, const int tdir,
const int i, const int j, const int k,
amrex::Array4<amrex::Real const> const& Ex,
amrex::Array4<amrex::Real const> const& Ey,
amrex::Array4<amrex::Real const> const& Ez,
amrex::Real& Fl, amrex::Real& Fr);

void
hlld(const amrex::Box& bx,
amrex::Array4<amrex::Real const> const& qleft,
Expand Down
9 changes: 9 additions & 0 deletions Source/mhd/Castro_mhd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ Castro::construct_ctu_mhd_source(Real time, Real dt)
qtmp_right_arr, qtmp_left_arr,
ux_right_arr, ux_left_arr,
flxy1D_arr, Ex_arr, Ez_arr,
Ex_arr, Ey_arr, Ez_arr,
0, 1, 2, dt);

// Calculate Flux 2D eq. 40
Expand All @@ -395,6 +396,7 @@ Castro::construct_ctu_mhd_source(Real time, Real dt)
qtmp_right_arr, qtmp_left_arr,
ux_right_arr, ux_left_arr,
flxz1D_arr, Ex_arr, Ey_arr,
Ex_arr, Ey_arr, Ez_arr,
0, 2, 1, dt);

// F^{x|z}
Expand All @@ -415,6 +417,7 @@ Castro::construct_ctu_mhd_source(Real time, Real dt)
qtmp_right_arr, qtmp_left_arr,
uy_right_arr, uy_left_arr,
flxx1D_arr, Ey_arr, Ez_arr,
Ex_arr, Ey_arr, Ez_arr,
1, 0, 2, dt);

// F^{y|x}
Expand All @@ -430,6 +433,7 @@ Castro::construct_ctu_mhd_source(Real time, Real dt)
qtmp_right_arr, qtmp_left_arr,
uy_right_arr, uy_left_arr,
flxz1D_arr, Ey_arr, Ex_arr,
Ex_arr, Ey_arr, Ez_arr,
1, 2, 0, dt);

// F^{y|z}
Expand All @@ -449,6 +453,7 @@ Castro::construct_ctu_mhd_source(Real time, Real dt)
qtmp_right_arr, qtmp_left_arr,
uz_right_arr, uz_left_arr,
flxx1D_arr, Ez_arr, Ey_arr,
Ex_arr, Ey_arr, Ez_arr,
2, 0, 1, dt);

// F^{z|x}
Expand All @@ -464,6 +469,7 @@ Castro::construct_ctu_mhd_source(Real time, Real dt)
qtmp_right_arr, qtmp_left_arr,
uz_right_arr, uz_left_arr,
flxy1D_arr, Ez_arr, Ex_arr,
Ex_arr, Ey_arr, Ez_arr,
2, 1, 0, dt);

// F^{z|y}
Expand Down Expand Up @@ -535,6 +541,7 @@ Castro::construct_ctu_mhd_source(Real time, Real dt)
ux_right_arr, ux_left_arr,
flx_yz_arr, flx_zy_arr,
Ex_arr, Ey_arr, Ez_arr,
Ex_arr, Ey_arr, Ez_arr,
0, 1, 2, dt);

// Final Fluxes eq.47
Expand All @@ -552,6 +559,7 @@ Castro::construct_ctu_mhd_source(Real time, Real dt)
uy_right_arr, uy_left_arr,
flx_xz_arr, flx_zx_arr,
Ey_arr, Ex_arr, Ez_arr,
Ex_arr, Ey_arr, Ez_arr,
1, 0, 2, dt);

hlld(nby1, qtmp_left_arr, qtmp_right_arr, flux[1].array(), 1);
Expand All @@ -564,6 +572,7 @@ Castro::construct_ctu_mhd_source(Real time, Real dt)
uz_right_arr, uz_left_arr,
flx_xy_arr, flx_yx_arr,
Ez_arr, Ex_arr, Ey_arr,
Ex_arr, Ey_arr, Ez_arr,
2, 0, 1, dt);

hlld(nbz1, qtmp_left_arr, qtmp_right_arr, flux[2].array(), 2);
Expand Down
Loading