From f742662d9ab7b82f9deca20f2312990063adc075 Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Fri, 25 Nov 2022 18:26:26 -0300 Subject: [PATCH 1/2] README: Update supported Riemann solvers. Signed-off-by: Grzegorz Kowal --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44f2749..2e75a08 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ following features are already implemented: * high order reconstructions: from 2nd to 9th order WENO and MP, both explicit and compact methods, the 2nd order TVD interpolation has a number of limiters supported, -* Riemann solvers of Roe- and HLL-types (HLL, HLLC, and HLLD), +* Riemann solvers of KEPES-, Roe- and HLL-types (HLL, HLLC, and HLLD), * standard boundary conditions: periodic, open, reflective, hydrostatic, etc. * turbulence driving using Alvelius or Ornstein–Uhlenbeck methods, * viscous and resistive source terms, From f59db0375f581480de461afd05675054867cc067 Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Sun, 27 Nov 2022 15:55:57 -0300 Subject: [PATCH 2/2] FORCING: Add parameter 'driving_velocity'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By default this parameter is set to zero and the behavior is the same as before. However, if this parameter is set to a value larger than zero, it determines the driving time scale for the Ornstein–Uhlenbeck method, and the injection power for the Alvelius method. Signed-off-by: Grzegorz Kowal --- sources/forcing.F90 | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/sources/forcing.F90 b/sources/forcing.F90 index e93e7c3..4916e49 100644 --- a/sources/forcing.F90 +++ b/sources/forcing.F90 @@ -96,7 +96,7 @@ module forcing real(kind=8), save :: fpower = 1.0d+00 real(kind=8), save :: lscale = 5.0d-01 real(kind=8), save :: tscale = 1.0d+00 - real(kind=8), save :: vscale = 5.0d-01 + real(kind=8), save :: vscale = 0.0d+00 real(kind=8), save :: ascale = 5.0d-01 real(kind=8), save :: kf = 2.0d+00 real(kind=8), save :: kl = 0.0d+00 @@ -274,6 +274,15 @@ module forcing end if tscale = 1.0d+00 end if + call get_parameter("driving_velocity", vscale) + if (vscale < 0.0d+00) then + if (verbose) then + write(*,*) + write(*,wfmt) "'driving_velocity' must be positive!" + write(*,wfmt) "Resetting it to the default value: 0.0!" + end if + vscale = 0.0d+00 + end if case("Alvelius", "alvelius", "al") forcing_enabled = .true. @@ -292,6 +301,15 @@ module forcing end if fpower = 1.0d+00 end if + call get_parameter("driving_velocity", vscale) + if (vscale < 0.0d+00) then + if (verbose) then + write(*,*) + write(*,wfmt) "'driving_velocity' must be positive!" + write(*,wfmt) "Resetting it to the default value: 0.0!" + end if + vscale = 0.0d+00 + end if case default injection_method = injection_none @@ -706,7 +724,11 @@ module forcing ! instantenous injection rate) ! lscale = 1.0d+00 / kf - vscale = lscale / tscale + if (vscale > 0.0d+00) then + tscale = lscale / vscale + else + vscale = lscale / tscale + end if ascale = sqrt(2.0d+00) * lscale / tscale**2 / sqrt(tscale) fpower = vscale**2 / tscale @@ -742,8 +764,13 @@ module forcing ! get the characteristic driving length, velocity, time, and acceleration scales ! lscale = 1.0d+00 / kf - tscale = sqrt(lscale / sqrt(2.0d+00 * fpower)) - vscale = lscale / tscale + if (vscale > 0.0d+00) then + tscale = lscale / vscale + fpower = 5.0d-01 * (vscale**2 / lscale)**2 + else + tscale = sqrt(lscale / sqrt(2.0d+00 * fpower)) + vscale = lscale / tscale + end if ascale = vscale / tscale ! normalize the driving amplitude profile to the driving power