1 #include "periodic_1D_unsteady.h" 11 template <
int dim,
int nspecies,
int nstate>
14 , unsteady_data_table_filename_with_extension(this->all_param.flow_solver_param.unsteady_data_table_filename+
".txt")
20 template <
int dim,
int nspecies,
int nstate>
26 dealii::LinearAlgebra::distributed::Vector<double> temp;
27 temp.reinit(dg->solution);
29 dg->apply_global_mass_matrix(dg->solution, temp);
31 dg->global_mass_matrix.vmult(temp,dg->solution);
33 return temp * dg->solution;
36 template <
int dim,
int nspecies,
int nstate>
44 template <
int dim,
int nspecies,
int nstate>
48 const std::shared_ptr <dealii::TableHandler> unsteady_data_table,
49 const bool do_write_unsteady_data_table_file)
52 const unsigned int current_iteration = ode_solver->current_iteration;
53 const double current_time = ode_solver->current_time;
62 if (pde_type == PDEEnum::advection){
63 if ((current_iteration % output_solution_every_n_iterations) == 0){
64 this->
pcout <<
" Iter: " << current_iteration
65 <<
" Time: " << current_time
69 (void) unsteady_data_table;
71 else if (pde_type == PDEEnum::burgers_inviscid){
74 if (output_solution_every_n_iterations > 0 && (current_iteration % output_solution_every_n_iterations) == 0){
75 this->
pcout <<
" Iter: " << current_iteration
76 <<
" Time: " << current_time
77 <<
" Energy: " << energy
84 const bool is_reference_solution = (dt < 2 * final_time/number_timesteps_ref);
86 if(this->
mpi_rank==0 && !is_reference_solution) {
88 unsteady_data_table->add_value(
"iteration", current_iteration);
91 if(do_write_unsteady_data_table_file) {
93 unsteady_data_table->write_text(unsteady_data_table_file);
100 #if PHILIP_DIM==1 && PHILIP_SPECIES==1 double final_time
Final solution time.
PartialDifferentialEquation pde_type
Store the PDE type to be solved.
const Parameters::AllParameters all_param
All parameters.
TimeRefinementStudyParam time_refinement_study_param
Contains the parameters for time refinement study.
FlowSolverParam flow_solver_param
Contains the parameters for simulation cases (flow solver test)
int output_solution_every_x_steps
Outputs the solution every x steps to .vtk file.
Periodic1DUnsteady(const Parameters::AllParameters *const parameters_input)
Constructor.
PartialDifferentialEquation
Possible Partial Differential Equations to solve.
Files for the baseline physics.
void compute_unsteady_data_and_write_to_table(const std::shared_ptr< ODE::ODESolverBase< dim, nspecies, double >> ode_solver, const std::shared_ptr< DGBase< dim, nspecies, double >> dg, const std::shared_ptr< dealii::TableHandler > unsteady_data_table, const bool do_write_unsteady_data_table_file) override
Compute the desired unsteady data and write it to a table.
int number_of_timesteps_for_reference_solution
For time refinement study with reference solution, number of steps for reference solution.
double output_solution_every_dt_time_intervals
Outputs the solution every dt time intervals to .vtk file.
Main parameter class that contains the various other sub-parameter classes.
std::string unsteady_data_table_filename_with_extension
Filename for unsteady data.
ODESolverParam ode_solver_param
Contains parameters for ODE solver.
double initial_time_step
Time step used in ODE solver.
double compute_energy(const std::shared_ptr< DGBase< dim, nspecies, double >> dg) const
Calculate energy as a matrix-vector product, solution^T (M+K) solution.
double get_numerical_entropy(const std::shared_ptr< DGBase< dim, nspecies, double >> dg) const
bool use_inverse_mass_on_the_fly
Flag to use inverse mass matrix on-the-fly for explicit solves.
dealii::ConditionalOStream pcout
ConditionalOStream.
void add_value_to_data_table(const double value, const std::string value_string, const std::shared_ptr< dealii::TableHandler > data_table) const
Add a value to a given data table with scientific format.
DGBase is independent of the number of state variables.
const int mpi_rank
MPI rank.