1 #include "taylor_green_vortex_energy_check.h" 2 #include "flow_solver/flow_solver_factory.h" 3 #include "flow_solver/flow_solver_cases/periodic_turbulence.h" 8 template <
int dim,
int nstate>
11 const dealii::ParameterHandler ¶meter_handler_input)
13 , parameter_handler(parameter_handler_input)
14 , kinetic_energy_expected(parameters_input->flow_solver_param.expected_kinetic_energy_at_final_time)
15 , theoretical_dissipation_rate_expected(parameters_input->flow_solver_param.expected_theoretical_dissipation_rate_at_final_time)
18 template <
int dim,
int nstate>
23 static_cast<void>(flow_solver->run());
26 std::unique_ptr<FlowSolver::PeriodicTurbulence<dim, nstate>> flow_solver_case = std::make_unique<FlowSolver::PeriodicTurbulence<dim,nstate>>(this->
all_parameters);
27 flow_solver_case->compute_and_update_integrated_quantities(*(flow_solver->dg));
28 const double kinetic_energy_computed = flow_solver_case->get_integrated_kinetic_energy();
29 const double theoretical_dissipation_rate_computed = flow_solver_case->get_vorticity_based_dissipation_rate();
33 if (relative_error_kinetic_energy > 1.0e-10) {
34 pcout <<
"Computed kinetic energy is not within specified tolerance with respect to expected value." << std::endl;
37 if (relative_error_theoretical_dissipation_rate > 1.0e-10) {
38 pcout <<
"Computed theoretical dissipation rate is not within specified tolerance with respect to expected value." << std::endl;
41 pcout <<
" Test passed, computed kinetic energy and theoretical dissipation rate are within specified tolerance." << std::endl;
Files for the baseline physics.
Main parameter class that contains the various other sub-parameter classes.
TaylorGreenVortexEnergyCheck(const Parameters::AllParameters *const parameters_input, const dealii::ParameterHandler ¶meter_handler_input)
Constructor.
static std::unique_ptr< FlowSolver< dim, nstate > > select_flow_case(const Parameters::AllParameters *const parameters_input, const dealii::ParameterHandler ¶meter_handler_input)
Factory to return the correct flow solver given input file.
const Parameters::AllParameters *const all_parameters
Pointer to all parameters.
int run_test() const override
Run test.
const dealii::ParameterHandler & parameter_handler
Parameter handler for storing the .prm file being ran.
Taylor Green Vortex Energy Check.
const double theoretical_dissipation_rate_expected
Expected theoretical dissipation rate at final time.
dealii::ConditionalOStream pcout
ConditionalOStream.
const double kinetic_energy_expected
Expected kinetic energy at final time.
Base class of all the tests.