ryujin 2.5.0 revision 3a6c8d57210175dea14d8116e1fe878f349f8c1c
Loading...
Searching...
No Matches
flux_burgers.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2023 - 2026 by the ryujin authors
4//
5
6#pragma once
7
8#include <ryujin/base/compile_time_options.h>
10
11namespace ryujin
12{
13 namespace Fluxes
14 {
20 class Burgers : public Flux
21 {
22 public:
23 Burgers(const std::string &subsection)
24 : Flux("burgers", subsection)
25 {
26 flux_formula_ = "f(u)={0.5u^2}";
27 }
28
29
30 double value(const double state,
31 const unsigned int /*direction*/) const override
32 {
33 return 0.5 * state * state;
34 }
35
36
37 double gradient(const double state,
38 const unsigned int /*direction*/) const override
39 {
40 return state;
41 }
42 };
43 } // namespace Fluxes
44} // namespace ryujin
std::string flux_formula_
Definition flux.h:84
double gradient(const double state, const unsigned int) const override
Burgers(const std::string &subsection)
double value(const double state, const unsigned int) const override