From 739bef38b51471206eca19c77f45e31b312d08b2 Mon Sep 17 00:00:00 2001 From: Schulik Date: Thu, 15 Oct 2020 15:52:16 +0100 Subject: [PATCH] Finished first working version --- aiolos.h | 3 ++- helpers.cpp | 2 +- init_and_bounds.cpp | 29 ++++++++++++++++++----------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/aiolos.h b/aiolos.h index d9b1949..8fd7060 100644 --- a/aiolos.h +++ b/aiolos.h @@ -195,8 +195,9 @@ class hydro_run double rs_time; int init_static_atmosphere; int static_atmosphere_tempprofile; + double gamma_adiabat; //ratio of specific heats - double ggminusone; + //double ggminusone; double mdot; double cv; double const_T; diff --git a/helpers.cpp b/helpers.cpp index 6783c72..7efd982 100644 --- a/helpers.cpp +++ b/helpers.cpp @@ -92,7 +92,7 @@ std::vector np_zeros(int size) { // // Return a 1-D array of one, identical to the numpy function // -std::vector nnp_ones(int size) { +std::vector np_ones(int size) { return std::vector(size, 1.0) ; } diff --git a/init_and_bounds.cpp b/init_and_bounds.cpp index 832895d..2673003 100644 --- a/init_and_bounds.cpp +++ b/init_and_bounds.cpp @@ -123,16 +123,6 @@ hydro_run::hydro_run(string filename, double debug_) { //finalplotnumber = 1 solver = 0; - ////~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // - // Physical - // - ////~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - gamma_adiabat = read_parameter_from_file(filename,"PARI_GAMMA", debug).value; //ratio of specific heats - ggminusone = gamma_adiabat*(gamma_adiabat-1.); - const_T = read_parameter_from_file(filename,"PARI_CONST_TEMP", debug).value; - T_increment = read_parameter_from_file(filename,"PARI_TEMP_INCR", debug).value; ////~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // @@ -276,6 +266,23 @@ hydro_run::hydro_run(string filename, double debug_) { source = init_AOS(num_cells+2); //Parabolic Variables: gravitational potential source_pressure = init_AOS(num_cells+2); //Parabolic Variables: gravitational potential flux = init_AOS(num_cells+1); + + + ////~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // + // Physical + // + ////~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + //double const_gamma_adiabat = read_parameter_from_file(filename,"PARI_GAMMA", debug).value; //ratio of specific heats + gamma_adiabat = read_parameter_from_file(filename,"PARI_GAMMA", debug).value; + //double const_cv = read_parameter_from_file(filename,"PARI_CV", debug).value; //ratio of specific heats + cv = 1; + const_T = read_parameter_from_file(filename,"PARI_CONST_TEMP", debug).value; + T_increment = read_parameter_from_file(filename,"PARI_TEMP_INCR", debug).value; + + + //left_ghost = AOS(0,0,0); //right_ghost= AOS(0,0,0); @@ -411,7 +418,7 @@ hydro_run::hydro_run(string filename, double debug_) { void hydro_run::initialize_hydrostatic_atmosphere_nonuniform() { cout<<"ATTENTION: Initializing nonuniform hydrostatic atmosphere and overwriting prior initial values."<