The text editor I use to edit stuff remotely is a complete piece of &^$%$, does not synchronize the files correctly. This commit fixes the issues introduced in the last commit

This commit is contained in:
jpekkila
2019-07-26 14:22:22 +03:00
parent b90d261e89
commit 5044228967
2 changed files with 17 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2014-2018, Johannes Pekkilae, Miikka Vaeisalae.
Copyright (C) 2014-2019, Johannes Pekkilae, Miikka Vaeisalae.
This file is part of Astaroth.
@@ -28,8 +28,8 @@
#include <stdlib.h>
#include <string.h>
#include "src/core/errchk.h"
#include "run.h"
#include "src/core/errchk.h"
// Write all errors from stderr to an <errorlog_name> in the current working
// directory

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2014-2018, Johannes Pekkilae, Miikka Vaeisalae.
Copyright (C) 2014-2019, Johannes Pekkilae, Miikka Vaeisalae.
This file is part of Astaroth.
@@ -44,14 +44,17 @@ host_timestep(const AcReal& umax, const AcMeshInfo& mesh_info)
const long double dsmin = mesh_info.real_params[AC_dsmin];
// Old ones from legacy Astaroth
//const long double uu_dt = cdt * (dsmin / (umax + cs_sound));
//const long double visc_dt = cdtv * dsmin * dsmin / nu_visc;
// const long double uu_dt = cdt * (dsmin / (umax + cs_sound));
// const long double visc_dt = cdtv * dsmin * dsmin / nu_visc;
// New, closer to the actual Courant timestep
// See Pencil Code user manual p. 38 (timestep section)
const long double uu_dt = cdt * dsmin / (fabsl(umax) + sqrtl(cs2_sound + 0.0l));
const long double visc_dt = cdtv * dsmin * dsmin / max(max(nu_visc, eta), max(gamma, chi));// + 1; // TODO NOTE: comment the +1 out to get scientifically accurate results
//MV: White the +1? It was messing up my computations!
const long double visc_dt = cdtv * dsmin * dsmin /
max(max(nu_visc, eta),
max(gamma, chi)); // + 1; // TODO NOTE: comment the +1 out to
// get scientifically accurate results
// MV: White the +1? It was messing up my computations!
const long double dt = min(uu_dt, visc_dt);
return AcReal(timescale) * AcReal(dt);