ryujin 2.1.1 revision 46bf70e400e423a8ffffe8300887eeb35b8dfb2c
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 by the ryujin authors
4//
5
6#pragma once
7
8#include <compile_time_options.h>
9
10#include "flux.h"
11
12namespace ryujin
13{
14 namespace FluxLibrary
15 {
21 class Burgers : public Flux
22 {
23 public:
24 Burgers(const std::string &subsection)
25 : Flux("burgers", subsection)
26 {
27 flux_formula_ = "f(u)={0.5u^2}";
28 }
29
30
31 double value(const double state,
32 const unsigned int /*direction*/) const override
33 {
34 return 0.5 * state * state;
35 }
36
37
38 double gradient(const double state,
39 const unsigned int /*direction*/) const override
40 {
41 return state;
42 }
43 };
44 } // namespace FluxLibrary
45} // namespace ryujin
double gradient(const double state, const unsigned int) const override
Definition: flux_burgers.h:38
double value(const double state, const unsigned int) const override
Definition: flux_burgers.h:31
Burgers(const std::string &subsection)
Definition: flux_burgers.h:24
std::string flux_formula_
Definition: flux.h:87