From d0eb308f17ca2d0ac5c82fa3aa77ca283d348ea6 Mon Sep 17 00:00:00 2001 From: Miikka Vaisala Date: Tue, 2 Jul 2019 16:35:14 +0800 Subject: [PATCH] Better interface to forcing. --- config/astaroth.conf | 4 ++++ include/astaroth.h | 4 +++- src/standalone/simulation.cc | 11 ++++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/config/astaroth.conf b/config/astaroth.conf index 6d83764..41b7e51 100644 --- a/config/astaroth.conf +++ b/config/astaroth.conf @@ -38,6 +38,10 @@ AC_chi = 0.0001 // Forcing AC_relhel = 0.0 +AC_forcing_magnitude = 1e-5 +AC_kmin = 0.8 +AC_kmax = 1.2 + // Entropy AC_cp_sound = 1.0 diff --git a/include/astaroth.h b/include/astaroth.h index 3776a60..efc2ad1 100644 --- a/include/astaroth.h +++ b/include/astaroth.h @@ -142,7 +142,6 @@ extern "C" { FUNC(AC_cs_sound), \ FUNC(AC_eta), \ FUNC(AC_mu0), \ - FUNC(AC_relhel), \ FUNC(AC_cp_sound), \ FUNC(AC_gamma), \ FUNC(AC_cv_sound), \ @@ -160,6 +159,9 @@ extern "C" { FUNC(AC_lnrho_out),\ /* Forcing parameters. User configured. */\ FUNC(AC_forcing_magnitude),\ + FUNC(AC_relhel), \ + FUNC(AC_kmin), \ + FUNC(AC_kmax), \ /* Forcing parameters. Set by the generator. */\ FUNC(AC_forcing_phase),\ FUNC(AC_k_forcex),\ diff --git a/src/standalone/simulation.cc b/src/standalone/simulation.cc index 659e382..d40aeca 100644 --- a/src/standalone/simulation.cc +++ b/src/standalone/simulation.cc @@ -166,6 +166,7 @@ static inline void helical_forcing_special_vector(AcReal3* ff_hel_re, AcReal3* ff_hel_im, const AcReal3 k_force, const AcReal3 e_force, const AcReal relhel) { + // k dot e AcReal3 kdote; kdote.x = k_force.x * e_force.x; @@ -385,11 +386,11 @@ run_simulation(void) AcReal bin_save_t = mesh_info.real_params[AC_bin_save_t]; AcReal bin_crit_t = bin_save_t; - //Placeholders until determined properly - AcReal magnitude = 1e-5; - AcReal relhel = 0.0; - AcReal kmin = 0.8; - AcReal kmax = 1.2; + //Forcing properties + AcReal relhel = mesh_info.real_params[AC_relhel]; + AcReal magnitude = mesh_info.real_params[AC_forcing_magnitude]; + AcReal kmin = mesh_info.real_params[AC_kmin]; + AcReal kmax = mesh_info.real_params[AC_kmax]; AcReal kaver = (kmax - kmin)/AcReal(2.0);