diff --git a/acc/mhd_solver/stencil_defines.h b/acc/mhd_solver/stencil_defines.h index dbd632e..ebec464 100644 --- a/acc/mhd_solver/stencil_defines.h +++ b/acc/mhd_solver/stencil_defines.h @@ -123,6 +123,7 @@ /* Additional helper params */\ /* (deduced from other params do not set these directly!) */\ FUNC(AC_G_const),\ + FUNC(AC_unit_mass),\ FUNC(AC_GM_star),\ FUNC(AC_sq2GM_star),\ FUNC(AC_cs2_sound), \ diff --git a/src/standalone/config_loader.cc b/src/standalone/config_loader.cc index e7885a3..0d6085b 100644 --- a/src/standalone/config_loader.cc +++ b/src/standalone/config_loader.cc @@ -137,11 +137,19 @@ update_config(AcMeshInfo* config) 6.674e-8); // g/cm3/s GGS definition //TODO define in a separate module AcReal M_sun = AcReal(1.989e33); // g solar mass - config->real_params[AC_M_sink] = config->real_params[AC_M_sink_Msun] * M_sun / - ((config->real_params[AC_unit_length] * - config->real_params[AC_unit_length] * - config->real_params[AC_unit_length]) * - config->real_params[AC_unit_density]); + + config->real_params[AC_unit_mass] = (config->real_params[AC_unit_length] * + config->real_params[AC_unit_length] * + config->real_params[AC_unit_length]) * + config->real_params[AC_unit_density]; + + + + + + + config->real_params[AC_M_sink] = config->real_params[AC_M_sink_Msun] * M_sun / + config->real_params[AC_unit_mass]; config->real_params[AC_G_const] = G_CONST_CGS / ((config->real_params[AC_unit_velocity] * config->real_params[AC_unit_velocity]) /