Skip to content

Commit

Permalink
update dt output
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWibking committed Nov 9, 2024
1 parent 838468e commit 7b71bc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/hydro/hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,13 +912,19 @@ Real EstimateHyperbolicTimestep(MeshData<Real> *md) {
const Real B_sq = SQR(B1) + SQR(B2) + SQR(B3);

// print sound speed
auto units = hydro_pkg->Param<Units>("units");
const parthenon::Real code_velocity_cgs = units.code_length_cgs() / units.code_time_cgs();
const parthenon::Real code_vel_kms = code_velocity_cgs / 1.0e5;
const parthenon::Real cs = eos_.SoundSpeed(w);
const parthenon::Real v_A = std::sqrt(B_sq / props.rho);
const parthenon::Real v_abs = std::sqrt(SQR(props.v1) + SQR(props.v2) + SQR(props.v3));

// print timestep
std::cout << "\n----> dt = " << cfl_hyp * min_dt_hyperbolic.value;
std::cout << " (c_s = " << cs << ", v_A = " << v_A << ", |v| = " << v_abs << ")\n";
std::cout << " (c_s = " << cs * code_vel_kms
<< " km/s, v_A = " << v_A * code_vel_kms
<< " km/s, |v| = " << v_abs * code_vel_kms
<< " km/s)\n";

// find which is largest
std::vector<parthenon::Real> v{cs, v_A, v_abs};
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ int main(int argc, char *argv[]) {
Hydro::HydroDriver driver(pman.pinput.get(), pman.app_input.get(), pman.pmesh.get());

// output restart file at t=0
driver.pouts->MakeOutputs(pman.pmesh.get(), pman.pinput.get(), &driver.tm, parthenon::SignalHandler::OutputSignal::now);
//driver.pouts->MakeOutputs(pman.pmesh.get(), pman.pinput.get(), &driver.tm, parthenon::SignalHandler::OutputSignal::now);

// This line actually runs the simulation
driver.Execute();
Expand Down

0 comments on commit 7b71bc6

Please sign in to comment.