Skip to content
Snippets Groups Projects
Commit 0675c774 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'karapiperis/fixes_and_improvements_in_mhd_io' into 'MHD_canvas'

Karapiperis/fixes and improvements in mhd io

See merge request !2099
parents 1db3eb3a beaf7909
No related branches found
No related tags found
3 merge requests!2119Mhd canvas,!2099Karapiperis/fixes and improvements in mhd io,!1530SPMHD implementations on top of SPHENIX and SPMHD examples
......@@ -51,7 +51,7 @@ with h5py.File(args.input, "r") as handle:
u = handle["PartType0/InternalEnergies"][:]
B = handle["PartType0/MagneticFluxDensities"][:]
divB = handle["PartType0/MagneticDivergences"][:]
psi = handle["PartType0/DednerScalars"][:]
psi = handle["PartType0/DednerScalarsOverCleaningSpeeds"][:]
git = handle["Code"].attrs["Git Revision"]
gitBranch = handle["Code"].attrs["Git Branch"]
scheme = handle["/HydroScheme"].attrs["Scheme"]
......
......@@ -50,7 +50,7 @@ with h5py.File(args.input, "r") as handle:
u = handle["PartType0/InternalEnergies"][:]
B = handle["PartType0/MagneticFluxDensities"][:]
divB = handle["PartType0/MagneticDivergences"][:]
psi = handle["PartType0/DednerScalars"][:]
psi = handle["PartType0/DednerScalarsOverCleaningSpeeds"][:]
git = handle["Code"].attrs["Git Revision"]
gitBranch = handle["Code"].attrs["Git Branch"]
scheme = handle["/HydroScheme"].attrs["Scheme"]
......
......@@ -41,9 +41,9 @@ INLINE static int mhd_read_particles(struct part* parts,
INLINE static void convert_B(const struct engine* e, const struct part* p,
const struct xpart* xp, float* ret) {
ret[0] = xp->mhd_data.B_over_rho_full[0] * p->rho;
ret[1] = xp->mhd_data.B_over_rho_full[1] * p->rho;
ret[2] = xp->mhd_data.B_over_rho_full[2] * p->rho;
ret[0] = p->mhd_data.B_over_rho[0] * p->rho;
ret[1] = p->mhd_data.B_over_rho[1] * p->rho;
ret[2] = p->mhd_data.B_over_rho[2] * p->rho;
}
/**
......@@ -390,15 +390,15 @@ INLINE static int mhd_write_particles(const struct part* parts,
"co-moving DivB of the particle");
list[2] = io_make_output_field(
"DednerScalars", FLOAT, 1, UNIT_CONV_ELECTRIC_CHARGE_FIELD_STRENGTH,
"DednerScalarsOverCleaningSpeeds", FLOAT, 1, UNIT_CONV_MAGNETIC_FIELD,
-1.5f * hydro_gamma - 1.f, parts, mhd_data.psi_over_ch,
"Dedner scalar associated to the particle");
"Dedner scalars over cleaning speeds of the particles");
list[3] = io_make_output_field(
"DednerScalarsdt", FLOAT, 1,
UNIT_CONV_ELECTRIC_CHARGE_FIELD_STRENGTH_RATE, 1.f, parts,
"DednerScalarsOverCleaningSpeedsdt", FLOAT, 1,
UNIT_CONV_MAGNETIC_FIELD_PER_TIME, 1.f, parts,
mhd_data.psi_over_ch_dt,
"Time derivative of Dedner scalar associated to particle");
"Time derivative of Dedner scalars over cleaning speeds of the particles");
list[4] = io_make_output_field(
"MagneticFluxDensitiesdt", FLOAT, 3, UNIT_CONV_MAGNETIC_FIELD_PER_TIME,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment